Skip to content

Commit 99d9964

Browse files
committed
Log port
1 parent 7c83868 commit 99d9964

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

src/test/java/org/java_websocket/misc/OpeningHandshakeRejectionTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public void run() {
132132
}
133133
}
134134
} catch (Exception e) {
135-
fail("There should be no exception", e);
135+
fail("There should not be an exception: " + e.getMessage() + " Port: " + port);
136136
}
137137
}
138138
});
@@ -218,9 +218,6 @@ public void testHandshakeRejectionTestCase11() throws Exception {
218218
}
219219

220220
private void testHandshakeRejection(int i) throws Exception {
221-
do {
222-
Thread.sleep(100);
223-
} while(serverSocket == null || !serverSocket.isBound());
224221
final int finalI = i;
225222
final CountDownLatch countDownLatch = new CountDownLatch(1);
226223
WebSocketClient webSocketClient = new WebSocketClient(

src/test/java/org/java_websocket/protocols/ProtocolHandshakeRejectionTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,6 @@ public void testHandshakeRejectionTestCase29() throws Exception {
488488
}
489489

490490
private void testProtocolRejection(int i, Draft_6455 draft) throws Exception {
491-
do {
492-
Thread.sleep(100);
493-
} while(serverSocket == null || !serverSocket.isBound());
494491
final int finalI = i;
495492
final CountDownLatch countDownLatch = new CountDownLatch(1);
496493
final WebSocketClient webSocketClient = new WebSocketClient(
@@ -615,7 +612,7 @@ public void onClose(int code, String reason, boolean remote) {
615612

616613
@Override
617614
public void onError(Exception ex) {
618-
fail("There should not be an exception: " + ex.getMessage());
615+
fail("There should not be an exception: " + ex.getMessage() + " Port: " + port);
619616
}
620617
};
621618
final AssertionError[] exc = new AssertionError[1];

src/test/java/org/java_websocket/util/SocketUtil.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public static int getAvailablePort() throws InterruptedException {
3636
return srv.getLocalPort();
3737
} catch (IOException e) {
3838
// Retry
39-
Thread.sleep(50);
4039
}
4140
}
4241
}

0 commit comments

Comments
 (0)