File tree 1 file changed +7
-2
lines changed
server/src/test/java/org/elasticsearch/common/network
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 23
23
24
24
import java .net .InetAddress ;
25
25
import java .net .NetworkInterface ;
26
+ import java .net .SocketException ;
26
27
import java .util .Collections ;
27
28
28
29
import static org .hamcrest .Matchers .containsString ;
@@ -88,8 +89,12 @@ public void testFilter() throws Exception {
88
89
*/
89
90
public void testAddressInterfaceLookup () throws Exception {
90
91
for (NetworkInterface netIf : NetworkUtils .getInterfaces ()) {
91
- if (!netIf .isUp () || Collections .list (netIf .getInetAddresses ()).isEmpty ()) {
92
- continue ;
92
+ try {
93
+ if (!netIf .isUp () || Collections .list (netIf .getInetAddresses ()).isEmpty ()) {
94
+ continue ;
95
+ }
96
+ } catch (SocketException e ) {
97
+ throw new AssertionError ("Failed to check if interface [" + netIf + "] is up" , e );
93
98
}
94
99
95
100
String name = netIf .getName ();
You can’t perform that action at this time.
0 commit comments