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

Andrey Turbanov aturbanov at openjdk.org
Tue Jul 9 19:51:23 UTC 2024


On Fri, 5 Jul 2024 10:50:56 GMT, Daniel Fuchs <dfuchs 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.

test/jdk/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java line 115:

> 113:                 if (sa == null) {
> 114:                     if (expectedSender != null) {
> 115:                         if (elapsed  > 4800) {

Suggestion:

                        if (elapsed > 4800) {

test/jdk/java/nio/channels/DatagramChannel/Promiscuous.java line 115:

> 113:                 if (sa == null) {
> 114:                     if (datagramExpected) {
> 115:                         if (elapsed  > 4800) {

Suggestion:

                        if (elapsed > 4800) {

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20050#discussion_r1671116020
PR Review Comment: https://git.openjdk.org/jdk/pull/20050#discussion_r1671116831


More information about the nio-dev mailing list