Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8264975

java/net/DatagramSocket/DatagramSocketMulticasting.java fails infrequently

    XMLWordPrintable

    Details

      Description

      The probable cause is that the network interface is being reconfigured while the test is running.

      The line that fails is:

      assertTrue(s.getOption(IP_MULTICAST_IF).equals(ni));

      Comparing two instances of NetworkInterface for equality is problematic because NetworkInterface::equals also compare the addresses bound to the network interface, and each instance of NetworkInterface has a snapshot of the addresses taken at the time the instance is created.

      The test should be improved to only compare NetworkInterface name/index.

      java.lang.RuntimeException
      at DatagramSocketMulticasting.assertTrue(DatagramSocketMulticasting.java:363)
      at DatagramSocketMulticasting.testNetworkInterface(DatagramSocketMulticasting.java:242)
      at DatagramSocketMulticasting.test(DatagramSocketMulticasting.java:106)
      at DatagramSocketMulticasting.main(DatagramSocketMulticasting.java:88)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:568)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
      at java.base/java.lang.Thread.run(Thread.java:831)

        Attachments

          Activity

            People

            Assignee:
            dfuchs Daniel Fuchs
            Reporter:
            dfuchs Daniel Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: