mattrpav commented on code in PR #2636:
URL: https://github.com/apache/activemq/pull/2636#discussion_r4318505542
##########
activemq-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportBrokerTest.java:
##########
@@ -134,7 +134,19 @@ protected String getDiscoveryUri() {
if ( groupName == null ) {
groupName = "group-"+System.currentTimeMillis();
}
- return "multicast://default?group="+groupName;
+ String discoveryUri = "multicast://default?group=" + groupName;
+ // On macOS, multicast sends on en0 failed with NoRouteToHostException
despite an existing route; using lo0 allowed this test to pass.
+ // Set activemq.test.multicast.networkInterface to override selection
for both group membership and outgoing advertisements.
+ // Example (passed locally on macOS): mvn -pl activemq-unit-tests -am
test -Dtest=DiscoveryTransportBrokerTest
+ // -Dsurefire.failIfNoSpecifiedTests=false
-Dactivemq.test.multicast.networkInterface=lo0
+ // Interface names vary by platform: macOS typically uses lo0, Linux
uses lo, and Windows uses different names. Loopback multicast
+ // support also varies, so leave the property unset to preserve
automatic selection rather than assuming a portable loopback interface.
+ String networkInterface =
System.getProperty("activemq.test.multicast.networkInterface");
Review Comment:
We have a GitHub action that builds on macOS. How do you suggest we automate
this vs rely on user provided parameter?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact