diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/SafariWebsocketDraft0Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/SafariWebsocketDraft0Test.java index 9b4af2d27c9..fb39dde130f 100644 --- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/SafariWebsocketDraft0Test.java +++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/SafariWebsocketDraft0Test.java @@ -95,10 +95,11 @@ public class SafariWebsocketDraft0Test CaptureSocket socket = servlet.captures.get(0); Assert.assertThat("CaptureSocket",socket,notNullValue()); - Assert.assertThat("CaptureSocket.isConnected", socket.awaitConnected(1000), is(true)); + Assert.assertThat("CaptureSocket.isConnected", socket.awaitConnected(10000), is(true)); // Give servlet time to process messages - threadSleep(1,TimeUnit.SECONDS); + for (int i=0;i<100 && socket.messages.size()<5;i++) + threadSleep(100,TimeUnit.MILLISECONDS); // Should have captured 5 messages. Assert.assertThat("CaptureSocket.messages.size",socket.messages.size(),is(5));