Skip to content

Commit

Permalink
Improve SimpleMemoryPipelineChannelTest
Browse files Browse the repository at this point in the history
  • Loading branch information
sandynz committed Oct 17, 2023
1 parent 5c6a968 commit be2082c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ void assertFetchRecordsTimeoutCorrectly() {
SimpleMemoryPipelineChannel simpleMemoryPipelineChannel = new SimpleMemoryPipelineChannel(10, new EmptyAckCallback());
long startMills = System.currentTimeMillis();
simpleMemoryPipelineChannel.fetchRecords(1, 1, TimeUnit.MILLISECONDS);
long endMills = System.currentTimeMillis();
assertTrue(endMills - startMills >= 1 && endMills - startMills < 50);
long delta = System.currentTimeMillis() - startMills;
assertTrue(delta >= 1 && delta < 50, "Delta is not in [1,50) : " + delta);
startMills = System.currentTimeMillis();
simpleMemoryPipelineChannel.fetchRecords(1, 500, TimeUnit.MILLISECONDS);
endMills = System.currentTimeMillis();
assertTrue(endMills - startMills >= 500 && endMills - startMills < 600);
delta = System.currentTimeMillis() - startMills;
assertTrue(delta >= 500 && delta < 650, "Delta is not in [500,650) : " + delta);
}
}

0 comments on commit be2082c

Please sign in to comment.