RFR: 8332535: Mark java/nio/channels/DatagramChannel/Loopback.java as intermittent [v5]

Daniel Fuchs dfuchs at openjdk.org
Wed Jun 26 15:11:11 UTC 2024


On Wed, 26 Jun 2024 15:00:45 GMT, SendaoYan <syan at openjdk.org> wrote:

>> Hi all,
>>   The test `test/jdk/java/nio/channels/DatagramChannel/Loopback.java` intermittent fail, the failure probability is about 2/1000. This PR mark this test intermittent, and print more messages to investigate the intermittent failure. Only change the testcase, no risk.
>
> SendaoYan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   add Thread.sleep(3000) in while loop

test/jdk/java/nio/channels/DatagramChannel/Loopback.java line 168:

> 166:                             // We're not supposed to receive stray datagrams here,
> 167:                             // so respin with 3 full seconds as this shouldn't happen too often
> 168:                             Thread.sleep(3000);

Sorry for being unclear - please remove that Thread.sleep().

What I meant is that the `continue` statement below will lead us to calling `sel.select(3000);` again at line 155, and since we're not expecting to receive any datagram, it will block for 3 seconds again. 

Anyway - that's what the test was doing already if receiving a datagram from a socket where `senderPort != localPort` - so that's probably OK to leave it like that.

Please revert the last change - what you had before was good.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19314#discussion_r1655065336


More information about the nio-dev mailing list