This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.6.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/3.6.x-fixes by this push:
     new 2db24ad8ae Attempt to fix 
org.apache.cxf.ws.discovery.WSDiscoveryClientTest.testMultiResponses by 
skipping docker interfaces (if available) and sorting them
2db24ad8ae is described below

commit 2db24ad8ae9491fc6cac82bcde215005e56200e8
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
---
 .../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 ea6ddf6e8e..8001c9b5ce 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
@@ -73,7 +73,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);
                             System.out.println("Found possible network 
interface:" + ni.getDisplayName());
                         }
@@ -87,12 +88,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 {

Reply via email to