提交 6014d53d 编写于 作者: T tyan

8022212: Intermittent test failures in java/net

Reviewed-by: chegar
上级 42dbce97
...@@ -33,11 +33,16 @@ import java.util.Enumeration; ...@@ -33,11 +33,16 @@ import java.util.Enumeration;
import static java.lang.System.out; import static java.lang.System.out;
public class IndexTest { public class IndexTest {
static final boolean isWindows = System.getProperty("os.name").startsWith("Windows");
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
Enumeration<NetworkInterface> netifs = NetworkInterface.getNetworkInterfaces(); Enumeration<NetworkInterface> netifs = NetworkInterface.getNetworkInterfaces();
NetworkInterface nif = null; NetworkInterface nif;
while (netifs.hasMoreElements()) { while (netifs.hasMoreElements()) {
nif = netifs.nextElement(); nif = netifs.nextElement();
// JDK-8022212, Skip (Windows) Teredo Tunneling seudo-Interface
if (nif.getDisplayName().contains("Teredo") && isWindows)
continue;
int index = nif.getIndex(); int index = nif.getIndex();
if (index >= 0) { if (index >= 0) {
NetworkInterface nif2 = NetworkInterface.getByIndex(index); NetworkInterface nif2 = NetworkInterface.getByIndex(index);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册