RFR: 8327650: Test java/nio/channels/DatagramChannel/StressNativeSignal.java timed out [v4]

Mark Sheppard msheppar at openjdk.org
Wed May 29 17:14:02 UTC 2024


On Wed, 29 May 2024 13:23:32 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Mark Sheppard has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   JDK-8327650: Test java/nio/channels/DatagramChannel/StressNativeSignal.java timed out — updated catch block to be consistent with idiom used in test
>
> test/jdk/java/nio/channels/DatagramChannel/StressNativeSignal.java line 51:
> 
>> 49:             System.err.println("failed to create and start a ServerSocketThread");
>> 50:             z.printStackTrace();
>> 51:         }
> 
> It's not clear to me why there is a catch Exception here, same thing when creating/starting UDPThread, wouldn't it be simpler to have the constructor throw so that the test fails with the exception if there is an error starting either thread?
> 
> I assume the two fields can be final too.

I will make the fields final.

I have retained the original structure of the test, and as indicated previously the tests are ambivalent to exceptions. I haven't changed that.  It would appears the test's objective is to trigger a 316 error and anything else is incidental. 

If there is a strong opinion in this regards, the test can be structured to fail fast  ... but note there are effectively two tests in one which can execute independent of each other to test the NativeThread.signal ... one or other might fail, but allow a valid test run.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19312#discussion_r1619227159


More information about the nio-dev mailing list