diff --git a/aeron-system-tests/src/test/java/io/aeron/cluster/StalledLeaderLogReplicationClusterTest.java b/aeron-system-tests/src/test/java/io/aeron/cluster/StalledLeaderLogReplicationClusterTest.java index d7107f95d0..3b071713bd 100644 --- a/aeron-system-tests/src/test/java/io/aeron/cluster/StalledLeaderLogReplicationClusterTest.java +++ b/aeron-system-tests/src/test/java/io/aeron/cluster/StalledLeaderLogReplicationClusterTest.java @@ -81,11 +81,9 @@ void shouldHandleMultipleElections() final TestNode leader0 = cluster.awaitLeader(); - final int numMessages = 3; + final int messageCount = 3; cluster.connectClient(); - cluster.sendMessages(numMessages); - cluster.awaitResponseMessageCount(numMessages); - cluster.awaitServicesMessageCount(numMessages); + cluster.sendAndAwaitMessages(messageCount, messageCount); cluster.stopNode(leader0); final TestNode leader1 = cluster.awaitLeader(leader0.index()); @@ -94,9 +92,7 @@ void shouldHandleMultipleElections() awaitElectionClosed(cluster.node(leader0.index())); cluster.connectClient(); - cluster.sendMessages(numMessages); - cluster.awaitResponseMessageCount(numMessages * 2); - cluster.awaitServicesMessageCount(numMessages * 2); + cluster.sendAndAwaitMessages(messageCount, messageCount * 2); cluster.stopNode(leader1); cluster.awaitLeader(leader1.index()); @@ -104,8 +100,6 @@ void shouldHandleMultipleElections() awaitElectionClosed(cluster.node(leader1.index())); cluster.connectClient(); - cluster.sendMessages(numMessages); - cluster.awaitResponseMessageCount(numMessages * 3); - cluster.awaitServicesMessageCount(numMessages * 3); + cluster.sendAndAwaitMessages(messageCount, messageCount * 2); } }