Skip to content

Commit c376092

Browse files
Increase timeout for slower machines like AIX. (SAP#2078)
* Increase timeout for slower machines like AIX. * Use proper exception when skipping. * Changed declared exception.
1 parent 1c57350 commit c376092

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

test/jdk/com/sun/jdi/FileSocketTransportTest.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ public static void main(String[] args) throws Throwable {
9999
try (SocketChannel channel = SocketChannel.open(StandardProtocolFamily.UNIX)) {
100100
// Just see if we can create a unix domain socket on Windows.
101101
} catch (UnsupportedOperationException e) {
102-
System.out.println("Windows version is too old to support unix domain sockets.");
103-
return;
102+
throw new jtreg.SkippedException("Windows version is too old to support unix domain sockets.");
104103
}
105104
}
106105

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

157-
private static void checkSocketPresent(String name) {
156+
private static void checkSocketPresent(String name) throws InterruptedException {
158157
if (!Platform.isWindows()) {
158+
for (int i = 0; i < 10; ++i) {
159+
if (!new File(name).exists()) {
160+
Thread.sleep(1000);
161+
} else {
162+
break;
163+
}
164+
}
165+
159166
assertTrue(new File(name).exists(), "Socket " + name + " missing");
160167
}
161168
}

0 commit comments

Comments
 (0)