RFR: 8334405: java/nio/channels/Selector/SelectWithConsumer.java#id0 failed in testWakeupDuringSelect
Daniel Fuchs
dfuchs at openjdk.org
Wed Jul 31 10:03:32 UTC 2024
On Tue, 30 Jul 2024 23:54:09 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
> Replace differences of milliseconds vs. epoch to differences of nanoseconds per the JVM's high-resolution time source.
Using `System.nanoTime` instead of `System.currentTimeMillis` looks like the right thing to do. I suggested some formatting edits to make the big power of tens more readable.
Oh I see Alan's comment now - I agree that printing millis would be more readable too.
test/jdk/java/nio/channels/Selector/SelectWithConsumer.java line 315:
> 313: long duration = System.nanoTime() - start;
> 314: assertTrue(n == 0);
> 315: assertTrue(duration > 500000000, "select took " + duration + " ns");
Suggestion:
assertTrue(duration > 500_000_000L, "select took " + duration + " ns");
test/jdk/java/nio/channels/Selector/SelectWithConsumer.java line 339:
> 337: long duration = System.nanoTime() - start;
> 338: assertTrue(n == 0);
> 339: assertTrue(duration < 5000000000L, "select took " + duration + " ns");
Suggestion:
assertTrue(duration < 5000_000_000L, "select took " + duration + " ns");
test/jdk/java/nio/channels/Selector/SelectWithConsumer.java line 361:
> 359: long duration = System.nanoTime() - start;
> 360: assertTrue(n == 0);
> 361: assertTrue(duration > 500000000L && duration < 10*1000000000L,
Suggestion:
assertTrue(duration > 500_000_000L && duration < 10_000_000_000L,
test/jdk/java/nio/channels/Selector/SelectWithConsumer.java line 388:
> 386: long duration = System.nanoTime() - start;
> 387: assertTrue(n == 0);
> 388: assertTrue(duration < 5000000000L, "select took " + duration + " ns");
Suggestion:
assertTrue(duration < 5000_000_000L, "select took " + duration + " ns");
-------------
PR Review: https://git.openjdk.org/jdk/pull/20398#pullrequestreview-2209710555
PR Comment: https://git.openjdk.org/jdk/pull/20398#issuecomment-2260137166
PR Review Comment: https://git.openjdk.org/jdk/pull/20398#discussion_r1698237118
PR Review Comment: https://git.openjdk.org/jdk/pull/20398#discussion_r1698241167
PR Review Comment: https://git.openjdk.org/jdk/pull/20398#discussion_r1698241279
PR Review Comment: https://git.openjdk.org/jdk/pull/20398#discussion_r1698242540
More information about the nio-dev
mailing list