Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions test/jdk/com/sun/jdi/FileSocketTransportTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ public static void main(String[] args) throws Throwable {
try (SocketChannel channel = SocketChannel.open(StandardProtocolFamily.UNIX)) {
// Just see if we can create a unix domain socket on Windows.
} catch (UnsupportedOperationException e) {
System.out.println("Windows version is too old to support unix domain sockets.");
return;
throw new jtreg.SkippedException("Windows version is too old to support unix domain sockets.");
}
}

Expand Down Expand Up @@ -137,7 +136,7 @@ public static void main(String[] args) throws Throwable {
for (int i = 0; i < 3; ++i) {
System.out.println("Run " + i);
// Wait a bit to let the debugging be set up properly.
Thread.sleep(3000);
Thread.sleep(1000);
checkSocketPresent(socketName);
read = handshake(socketName, handshake, received);
assertEquals(new String(handshake, "UTF-8"),
Expand All @@ -154,8 +153,16 @@ public static void main(String[] args) throws Throwable {
}
}

private static void checkSocketPresent(String name) {
private static void checkSocketPresent(String name) throws InterruptedException {
if (!Platform.isWindows()) {
for (int i = 0; i < 10; ++i) {
if (!new File(name).exists()) {
Thread.sleep(1000);
} else {
break;
}
}

assertTrue(new File(name).exists(), "Socket " + name + " missing");
}
}
Expand Down
Loading