This is an automated email from the ASF dual-hosted git repository. reta pushed a commit to branch 3.5.x-fixes in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 05a3e89220a25f3d42bcd59045c420e5974d8d97 Author: Andriy Redko <[email protected]> AuthorDate: Fri Oct 4 08:55:18 2024 -0400 Attempt to fix org.apache.cxf.ws.discovery.WSDiscoveryClientTest.testMultiResponses by skipping docker interfaces (if available) and sorting them (cherry picked from commit 2db24ad8ae9491fc6cac82bcde215005e56200e8) --- .../org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java b/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java index 168b2f25c8..1a396c0022 100644 --- a/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java +++ b/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java @@ -68,7 +68,8 @@ public final class WSDiscoveryClientTest { for (InterfaceAddress ia : ni.getInterfaceAddresses()) { if (ia.getAddress() instanceof java.net.Inet4Address && !ia.getAddress().isLoopbackAddress() && !ni.getDisplayName().startsWith("vnic") - && !ni.getDisplayName().startsWith("tailscale")) { + && !ni.getDisplayName().startsWith("tailscale") + && !ni.getDisplayName().startsWith("docker")) { possibles.add(ni); } } @@ -82,12 +83,10 @@ public final class WSDiscoveryClientTest { return p; } } - for (NetworkInterface p : possibles) { - if (p.getDisplayName().startsWith("docker")) { - System.out.println("Using docker network interface:" + p.getDisplayName()); - return p; - } - } + + // Sort interfaces predictably, in reverse order + possibles.sort((left, right) -> right.getDisplayName().compareTo(left.getDisplayName())); + if (possibles.isEmpty()) { return null; } else {
