RFR 8235475: Add additional timestamp to test java/nio/channels/Selector/SelectWithConsumer.java

Michael McMahon michael.x.mcmahon at oracle.com
Fri Dec 6 11:13:23 UTC 2019


Hi,

Could I get the following small instrumentation change to a test, 
reviewed please?

It just adds some additional logging for the case when the test fails.

Thanks,

Michael.

diff -r 4938269b8b17 
test/jdk/java/nio/channels/Selector/SelectWithConsumer.java
--- a/test/jdk/java/nio/channels/Selector/SelectWithConsumer.java Fri 
Dec 06 10:00:16 2019 +0100
+++ b/test/jdk/java/nio/channels/Selector/SelectWithConsumer.java Fri 
Dec 06 11:10:04 2019 +0000
@@ -454,10 +454,15 @@

          // select(Consumer, timeout)
          try (Selector sel = Selector.open()) {
+            long pre = System.currentTimeMillis();
              scheduleClose(sel, 3, SECONDS);
              long start = System.currentTimeMillis();
              int n = sel.select(k -> assertTrue(false), 60*1000);
              long duration = System.currentTimeMillis() - start;
+        if (duration < 2000) {
+        // Test failed so log the various timestamps
+        System.out.printf("pre=%d, start=%d, duration=%d\n", pre, 
start, duration);
+        }
              assertTrue(n == 0);
              assertTrue(duration > 2000 && duration < 10*1000,
                      "select took " + duration + " ms");



More information about the nio-dev mailing list