Skip to content

Commit 2cd884e

Browse files
committed
core: Reduce DeadlineTest flake
To my knowledge, there has been just a single DeadlineTest flake since the code was fixed to avoid issues with I/O due to class loading: io.grpc.DeadlineTest > defaultTickerIsSystemTicker[0] FAILED java.lang.AssertionError: <-21431071 ns from now> and <0 ns from now> should have been within <20000000ns> of each other But we don't really need fine-grained verification during the test though; if the code is not using nanoTime, then it is almost certainly not going to have even a day of accuracy (except on a fresh VM). So checking for a second of accuracy vs 20ms shouldn't really be an issue.
1 parent 4289aaf commit 2cd884e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/test/java/io/grpc/DeadlineTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public void defaultTickerIsSystemTicker() {
8181
ticker.reset(System.nanoTime());
8282
Deadline reference = Deadline.after(0, TimeUnit.SECONDS, ticker);
8383
// Allow inaccuracy to account for system time advancing during test.
84-
assertAbout(deadline()).that(d).isWithin(20, TimeUnit.MILLISECONDS).of(reference);
84+
assertAbout(deadline()).that(d).isWithin(1, TimeUnit.SECONDS).of(reference);
8585
}
8686

8787
@Test

0 commit comments

Comments
 (0)