RFR: 8264975: java/net/DatagramSocket/DatagramSocketMulticasting.java fails infrequently

Alan Bateman alanb at openjdk.java.net
Wed Jun 2 17:03:27 UTC 2021


On Wed, 2 Jun 2021 15:54:26 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

> Please find below a fix that will make `java/net/DatagramSocket/DatagramSocketMulticasting.java` more resilient to the rare case where addresses bound to a network interfaces are updated while the test is running.
> 
> Instead of using `NetworkInterface::equals` to compare network interfaces, the test now use `NetworkConfiguration::isSameInterface` which only looks at the network interface name and index and ignore the addresses which are bound to it.

I think this looks okay although returning false if ni1 or ni2 is subtle (it follows the Objects.equals check so it's okay but I did have to look at it twice).

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

Marked as reviewed by alanb (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/4313


More information about the net-dev mailing list