From c5e3ed5afe529f52096c3da69d55f2202d607dbf Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 11 Jan 2012 16:39:03 +1100 Subject: [PATCH] improved test timing --- .../eclipse/jetty/websocket/SafariWebsocketDraft0Test.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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));