From 93b6619f8f2329ede6487bcda5ef3e5c4d3e61b7 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Thu, 20 Jun 2019 18:23:32 +1000 Subject: [PATCH] fix flaky tests in ClientConnectTest race of Exception notifications between the CompletableFuture and the FrameHandler Signed-off-by: Lachlan Roberts --- .../eclipse/jetty/websocket/tests/client/ClientConnectTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jetty-websocket/jetty-websocket-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientConnectTest.java b/jetty-websocket/jetty-websocket-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientConnectTest.java index 2b04ce3f707..2dade9c7f9a 100644 --- a/jetty-websocket/jetty-websocket-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientConnectTest.java +++ b/jetty-websocket/jetty-websocket-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientConnectTest.java @@ -59,6 +59,7 @@ import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.fail; @@ -80,6 +81,7 @@ public class ClientConnectTest assertThat("ExecutionException.cause", cause, errorMatcher); // Validate websocket captured cause + assertDoesNotThrow(() -> wsocket.errorLatch.await(5, TimeUnit.SECONDS)); Throwable capcause = wsocket.error.get(); assertThat("Error", capcause, notNullValue()); assertThat("Error", capcause, errorMatcher);