JDK 9 RFR of 8176332: Increase sleep time in java/nio/channels/Selector/ChangingInterests.java write1()

Brian Burkhalter brian.burkhalter at oracle.com
Wed Mar 8 00:49:48 UTC 2017

Please review this test-only change for [1]:

--- a/test/java/nio/channels/Selector/ChangingInterests.java
+++ b/test/java/nio/channels/Selector/ChangingInterests.java
@@ -53,11 +53,11 @@
     static void write1(SocketChannel peer) throws IOException {
         peer.write(ByteBuffer.wrap(new byte[1]));
         // give time for other end to be readable
         try {
-            Thread.sleep(50);
+            Thread.sleep(150);
         } catch (InterruptedException ignore) { }

The failure in [2] is due to the SocketChannel not having become readable. In theory this could have been due to an insufficient pause on a heavily loaded system. To reduce the odds of this happening, this patch increases the pause time from 50 to 150 ms, an execution time increase for the test of 400 ms total as the method write1() is invoked four times.



[1] https://bugs.openjdk.java.net/browse/JDK-8176332
[2] https://bugs.openjdk.java.net/browse/JDK-8151749

More information about the nio-dev mailing list