JDK-8027212 : TEST_BUG: java/nio/channels/Selector/SelectAfterRead.java fails intermittently
  • Type: Bug
  • Status: Closed
  • Resolution: Fixed
  • Component: core-libs
  • Sub-Component: java.nio
  • Priority: P4
  • Affected Version: 8
  • Submit Date: 2013-10-24
  • Updated Date: 2016-06-13
  • Resolved Date: 2013-12-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
JDK 7 JDK 8 JDK 9
7u65Resolved 8u11Resolved 9 b01Fixed
Description
TESTFAIL:java/nio/channels/Selector/SelectAfterRead.java

The test java/nio/channels/Selector/SelectAfterRead.java fails in nightly intermittenly. see details below:

#section:main
----------messages:(3/131)----------
command: main SelectAfterRead
reason: Assumed action based on file name: run main SelectAfterRead 
elapsed time (seconds): 181.049
----------rerun:(18/1252)*----------
DISPLAY=sc11152338.us.oracle.com:1 \\
HOME=/Users/aurora \\
PATH=/bin:/usr/bin \\
TZ=PST8PDT \\
    /Users/aurora/sandbox/jdk/bin/java \\
        -Dtest.vm.opts='-ea -esa -Xmx512m' \\
        -Dcompile.jdk=/Users/aurora/sandbox/jdk \\
        -Dtest.src.path=/Users/aurora/sandbox/testbase/test/java/nio/channels/Selector \\
        -Dtest.src=/Users/aurora/sandbox/testbase/test/java/nio/channels/Selector \\
        -Dtest.tool.vm.opts='-J-ea -J-esa -J-Xmx512m' \\
        -Dtest.class.path=/Users/aurora/sandbox/gresults/testoutput/jdk_nio/JTwork/classes/java/nio/channels/Selector \\
        -Dtest.classes=/Users/aurora/sandbox/gresults/testoutput/jdk_nio/JTwork/classes/java/nio/channels/Selector \\
        -Dtest.class.path.prefix=/Users/aurora/sandbox/gresults/testoutput/jdk_nio/JTwork/classes/java/nio/channels/Selector:/Users/aurora/sandbox/testbase/test/java/nio/channels/Selector \\
        -Dtest.jdk=/Users/aurora/sandbox/jdk \\
        -Dtest.java.opts=-d64 \\
        -Dtest.compiler.opts= \\
        -classpath /Users/aurora/sandbox/gresults/testoutput/jdk_nio/JTwork/classes/java/nio/channels/Selector:/Users/aurora/sandbox/testbase/test/java/nio/channels/Selector:/Users/aurora/sandbox/jdk/lib/tools.jar \\
        SelectAfterRead
----------System.err:(12/607)----------
java.lang.Exception: One selected key expected
	at SelectAfterRead.main(SelectAfterRead.java:69)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at com.sun.javatest.regtest.MainAction$SameVMRunnable.run(MainAction.java:746)
	at java.lang.Thread.run(Thread.java:744)

JavaTest Message: Test threw exception: java.lang.Exception
JavaTest Message: shutting down test

result: Error. Error while cleaning up threads after test


test result: Error. Error while cleaning up threads after test
Comments
On further examination, this test (and others based on ByteServer) can be simplified as they don't require multiple threads to create the conditions that the tests require.
2013-12-14

Webrev link: http://cr.openjdk.java.net/~ewang/JDK-8027212/webrev.00/
2013-11-25

RFR mail link: http://mail.openjdk.java.net/pipermail/nio-dev/2013-November/002407.html
2013-11-19

Root Cause: The test is based on bad assumption that ByteServer thread is started within 1 second before sel.select(TIMEOUT) is called. (TIMEOUT=1000). Suggested Fix: Make sure the server is started before the call sel.select(TIMEOUT).
2013-11-15

I'm resolving this bug as incomplete as we need much more information about the environment (OS version in particular). Also some evidence to explain why it submitted a test bug - I ask this because if this test is failing then it may indicate a JDK or OS issue.
2013-10-24