Compare messages in the log 73/100773/1
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 24 Apr 2022 13:54:04 +0000 (15:54 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sun, 24 Apr 2022 13:54:52 +0000 (15:54 +0200)
Make sure we have the distinction between reordered messages and
messages getting missed.

JIRA: CONTROLLER-2024
Change-Id: If1f65eaa93b71911dcf197f8b053282f6ea0303c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RecoveryIntegrationTest.java

index ca53d2e..47b2994 100644 (file)
@@ -244,9 +244,9 @@ public class RecoveryIntegrationTest extends AbstractRaftActorIntegrationTest {
 
         reinstateLeaderActor();
 
 
         reinstateLeaderActor();
 
-        assertEquals("Leader last index", 5 , leaderActor.underlyingActor().getReplicatedLog().lastIndex());
-        assertEquals(payload4, leaderActor.underlyingActor().getReplicatedLog().get(4).getData());
-        assertEquals(payload5, leaderActor.underlyingActor().getReplicatedLog().get(5).getData());
+        final var log = leaderActor.underlyingActor().getReplicatedLog();
+        assertEquals("Leader last index", 5, log.lastIndex());
+        assertEquals(List.of(payload4, payload5), List.of(log.get(4).getData(), log.get(5).getData()));
     }
 
     private void reinstateLeaderActor() {
     }
 
     private void reinstateLeaderActor() {