java/net/MulticastSocket/NoLoopbackPackets.java failed on MacOSX with two problems.
First problem, it throws exception java.net.SocketException: Can't assign requested address, Please refer to CR 7160489 to see detailed description.
Second problem, MulticastSocket.setLoopbackMode(true) doesn't disable loopback mode, this issue only happened on MacOSX.
Adding debuging code after line 98, run with jdk 8 promoted build b32 and b33,
try {
msock.receive(packet);
//debugging
System.out.println("receive packet: "+ new String(buf));
System.out.println("We should not receive anything from following groups, but we did: "+group);
// it is an error if we receive something
failedGroups.add(group);
} catch (SocketTimeoutException e) {
// we expect this
}
Output is:
receive packet: hello world
We should not receive anything from following groups, but we did: /224.1.1.1:56770
receive packet: hello world
We should not receive anything from following groups, but we did: /224.1.1.2:56770