On Fri, 17 Dec 2021 16:21:59 GMT, Daniel Jeliński <d...@openjdk.java.net> wrote:
>> Can I please get a review for this test only change which proposes to enable >> debug logs from the test that failed intermittently? This change addresses >> https://bugs.openjdk.java.net/browse/JDK-8278961. >> >> The change passes the (test specific) `-d` option to enable logs from that >> test by default. While I was at it, I even added a few more debug logs >> hoping it might provide some hints if/when it fails next. >> >> For reference, a (successful) run of this test will now print something like: >> >> >> ----------System.out:(18/930)---------- >> running on OS that supports ICMP port unreachable >> Testing with class java.net.DatagramSocket >> tests will be run against destination address localhost/127.0.0.1 port 52682 >> Checking send to connected address ... >> socket is locally bound to address /127.0.0.1 port 52681 >> received data from address /127.0.0.1 port 52681 >> received data from address /127.0.0.1 port 52681 >> received data from address /127.0.0.1 port 52681 >> received data from address /127.0.0.1 port 52681 >> received data from address /127.0.0.1 port 52681 >> Checking send to non-connected address ... >> received data from address /127.0.0.1 port 52681 >> Checking send to invalid address ... >> Got expected exception: java.net.PortUnreachableException >> Got expected exception: java.net.PortUnreachableException >> Got expected exception: java.net.PortUnreachableException >> Got expected exception: java.net.PortUnreachableException >> Got expected exception: java.net.PortUnreachableException > > test/jdk/java/net/DatagramSocket/SendDatagramToBadAddress.java line 178: > >> 176: p = new DatagramPacket(buf, buf.length, addr, port); >> 177: sock.receive (p); >> 178: print("(unexpectedly) received data from address " + >> p.getAddress() > > We should immediately fail the test here Hello Daniel, I had considered that when doing this change. But this test itself appears to be very old one and I don't have any historical context of why it is doing these checks in a loop. Furthermore, even after it receives an exception (either a socket timeout one or any general exception), after setting a flag in case of a general exception, the test continues to run the next iteration of the loop. So I didn't want to change that logic, at least not this PR whose aim is to just enable debug logging. However, if others too think we should fail here immediately, I'll go ahead do that change. ------------- PR: https://git.openjdk.java.net/jdk/pull/6883