RFR: 8333526: Restructure java/nio/channels/DatagramChannel/StressNativeSignal.java to a fail fast exception handling policy

serhiysachkov duke at openjdk.org
Mon Sep 15 13:41:29 UTC 2025


On Mon, 15 Sep 2025 13:23:08 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> This task addresses the restructuring of the test to handle exception, especially during test setup, in a more immediate "fail fast" manner.
>
> test/jdk/java/nio/channels/DatagramChannel/StressNativeSignal.java line 96:
> 
>> 94: 
>> 95:         public ServerSocketThread() throws IOException {
>> 96:             socket = new ServerSocket(1122);
> 
> Why are we not using port 0 here? Does this test really need to run on port 1122? I would recommend using port 0, and possibly InetAddress.getLoopbackAddress() (though that's less important since we don't expect anything to connect)

Didn't change those ports as in a PR that lead to the creation of the ticket, it was discussed(https://github.com/openjdk/jdk/pull/19312) and agreed that no changes require, but if the preferred way is to use  port 0 will update the test with it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27294#discussion_r2349035898


More information about the nio-dev mailing list