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 85a7472416166..ddc40961b073c 100644 --- a/server/src/test/java/org/elasticsearch/common/network/NetworkUtilsTests.java +++ b/server/src/test/java/org/elasticsearch/common/network/NetworkUtilsTests.java @@ -23,6 +23,7 @@ import java.net.InetAddress; import java.net.NetworkInterface; +import java.net.SocketException; import java.util.Collections; import static org.hamcrest.Matchers.containsString; @@ -88,8 +89,12 @@ public void testFilter() throws Exception { */ public void testAddressInterfaceLookup() throws Exception { for (NetworkInterface netIf : NetworkUtils.getInterfaces()) { - if (!netIf.isUp() || Collections.list(netIf.getInetAddresses()).isEmpty()) { - continue; + try { + if (!netIf.isUp() || Collections.list(netIf.getInetAddresses()).isEmpty()) { + continue; + } + } catch (SocketException e) { + throw new AssertionError("Failed to check if interface [" + netIf + "] is up", e); } String name = netIf.getName();