fix flaky tests in ClientConnectTest

race of Exception notifications between the CompletableFuture and
the FrameHandler

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2019-06-20 18:23:32 +10:00
parent e305736b02
commit 93b6619f8f
1 changed files with 2 additions and 0 deletions

View File

@ -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);