diff --git a/artio-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/SlowConsumerTest.java b/artio-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/SlowConsumerTest.java index 2bef3dccc2..95fae62f0d 100644 --- a/artio-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/SlowConsumerTest.java +++ b/artio-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/SlowConsumerTest.java @@ -149,7 +149,7 @@ public void shouldQuarantineThenDisconnectASlowConsumer() throws IOException hasBecomeSlow = true; } - sendMessage(); + sendMessageWithRetry(); } testSystem.poll(); @@ -174,6 +174,11 @@ private void sessionBecomesSlow() assertTrue(session.isSlowConsumer()); } + private void sendMessageWithRetry() + { + testSystem.awaitSend(this::sendMessage); + } + private long sendMessage() { if (sendMetadata) @@ -207,7 +212,7 @@ public void shouldRestoreConnectionFromSlowGroupWhenItCatchesUp() throws IOExcep } while (bytesRead > 0); - sendMessage(); + sendMessageWithRetry(); testSystem.poll(); } @@ -260,7 +265,7 @@ private ConnectedSessionInfo sessionBecomesSlow(final MessageTimingCaptor messag { for (int i = 0; i < 10; i++) { - sendMessage(); + sendMessageWithRetry(); } testSystem.poll();