diff --git a/server/src/test/java/org/elasticsearch/common/network/NetworkUtilsTests.java b/server/src/test/java/org/elasticsearch/common/network/NetworkUtilsTests.java index ddc40961b073c..9b659cd0e54dd 100644 --- a/server/src/test/java/org/elasticsearch/common/network/NetworkUtilsTests.java +++ b/server/src/test/java/org/elasticsearch/common/network/NetworkUtilsTests.java @@ -90,7 +90,10 @@ public void testFilter() throws Exception { public void testAddressInterfaceLookup() throws Exception { for (NetworkInterface netIf : NetworkUtils.getInterfaces()) { try { - if (!netIf.isUp() || Collections.list(netIf.getInetAddresses()).isEmpty()) { + // Ignoring virtual ethernet devices since e.g. Docker could be creating or removing them in the background breaking tests. + final String interfaceName = netIf.getName(); + if ((interfaceName != null && interfaceName.startsWith("veth")) || netIf.isUp() == false + || Collections.list(netIf.getInetAddresses()).isEmpty()) { continue; } } catch (SocketException e) {