diff --git a/jetty-monitor/src/test/java/org/eclipse/jetty/monitor/ThreadMonitorTest.java b/jetty-monitor/src/test/java/org/eclipse/jetty/monitor/ThreadMonitorTest.java index b41efa73ab5..02606f7ac09 100644 --- a/jetty-monitor/src/test/java/org/eclipse/jetty/monitor/ThreadMonitorTest.java +++ b/jetty-monitor/src/test/java/org/eclipse/jetty/monitor/ThreadMonitorTest.java @@ -27,6 +27,7 @@ import org.junit.Test; */ public class ThreadMonitorTest { + public final static int DURATION=5000; private int count; @Test @@ -49,12 +50,12 @@ public class ThreadMonitorTest Thread runner = new Thread(spinner); runner.start(); - Thread.sleep(15000); - + Thread.sleep(DURATION); + spinner.setDone(); monitor.stop(); - assertTrue(count > 10); + assertTrue(count >= 2); } @@ -73,22 +74,17 @@ public class ThreadMonitorTest /* ------------------------------------------------------------ */ public void run() { - while (!done) + long result=-1; + long end=System.currentTimeMillis()+DURATION+1000; + while (!done && System.currentTimeMillis()