diff --git a/src/test/java/com/redhat/rhjmc/containerjfr/tui/ws/MessagingServerTest.java b/src/test/java/com/redhat/rhjmc/containerjfr/tui/ws/MessagingServerTest.java index e9cc4894a1..8a9d209d96 100644 --- a/src/test/java/com/redhat/rhjmc/containerjfr/tui/ws/MessagingServerTest.java +++ b/src/test/java/com/redhat/rhjmc/containerjfr/tui/ws/MessagingServerTest.java @@ -167,7 +167,7 @@ void webSocketCloseHandlerShouldRemoveConnection() } @Test - void shouldHandleRemovedConnections() { + void shouldHandleRemovedConnections() throws Exception { String expectedText = "hello world"; when(crw2.readLine()).thenReturn(expectedText); @@ -191,6 +191,9 @@ void shouldHandleRemovedConnections() { String newText = "another message"; when(crw1.readLine()).thenReturn(newText); + // FIXME this is a dirty hack. See https://github.com/rh-jmc-team/container-jfr/issues/132 + Thread.sleep(500); + MatcherAssert.assertThat(server.getClientReader().readLine(), Matchers.equalTo(newText)); verify(crw1, Mockito.atLeastOnce()).readLine(); verifyNoMoreInteractions(crw2);