RFR: 8335771: Improve stability of java/nio/channels/DatagramChannel tests

Daniel Fuchs dfuchs at openjdk.org
Wed Jul 10 20:10:00 UTC 2024


On Mon, 8 Jul 2024 11:33:24 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Several `java/nio/channels/DatagramChannel` tests fail intermittently. Though it seems difficult to fix all intermittent failures due to the nature of what some of these attempt to test, the stability can still be improved.
>> 
>> The most common source of intermittent failures are:
>> 
>>  - not receiving a datagram due to port conflict or interference of concurrent running tests
>>  - failure to disconnect due to interference of concurrent running tests
>>  - failure due to reception of unexpected stray datagrams
>> 
>> Avoiding to bind on the wildcard address, filtering unexpected datagram, and some retrying can aleviate some of the issues and greatly reduce the frequency of intermittent failures.
>
> There are several tests modified to introduce some awkward control flow, specifically there are now condition and then code in the body conditionally doing "continue".  It would be a lot more readable to have the condition in one place in each of these loops.

@AlanBateman I have pushed an updated which hopefully will make things a bit better.

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

PR Comment: https://git.openjdk.org/jdk/pull/20050#issuecomment-2220978769


More information about the nio-dev mailing list