diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/GracefulStopTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/GracefulStopTest.java index 8e67c62bc3e..c5f2ae7990c 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/GracefulStopTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/GracefulStopTest.java @@ -232,7 +232,7 @@ public class GracefulStopTest assertThat(response2, containsString(" 503 ")); now = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); - Thread.sleep(end-now); + Thread.sleep(Math.max(1,end-now)); client1.getOutputStream().write("567890".getBytes()); } catch(Exception e)