Fixup assertions a bit 90/98390/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 10 Nov 2021 12:52:15 +0000 (13:52 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 10 Nov 2021 12:53:35 +0000 (13:53 +0100)
The tests are using different transaction mix, pass down explicit
expected transaction count.

Change-Id: I5007fe0ad90009fcafb727bac8d37bd07dfaae94
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreRemotingIntegrationTest.java

index 542a798..a1b3d4e 100644 (file)
@@ -387,7 +387,7 @@ public class DistributedDataStoreRemotingIntegrationTest extends AbstractTest {
 
                     final var clientMeta = frontendMetadata.getClients().get(0);
                     if (leaderDistributedDataStore.getActorUtils().getDatastoreContext().isUseTellBasedProtocol()) {
 
                     final var clientMeta = frontendMetadata.getClients().get(0);
                     if (leaderDistributedDataStore.getActorUtils().getDatastoreContext().isUseTellBasedProtocol()) {
-                        assertTellClientMetadata(clientMeta, numCars);
+                        assertTellClientMetadata(clientMeta, numCars * 2);
                     } else {
                         assertAskClientMetadata(clientMeta);
                     }
                     } else {
                         assertAskClientMetadata(clientMeta);
                     }
@@ -405,7 +405,7 @@ public class DistributedDataStoreRemotingIntegrationTest extends AbstractTest {
         assertEquals(List.of(), clientMeta.getCurrentHistories());
     }
 
         assertEquals(List.of(), clientMeta.getCurrentHistories());
     }
 
-    private void assertTellClientMetadata(final FrontendClientMetadata clientMeta, final int numCars) {
+    private void assertTellClientMetadata(final FrontendClientMetadata clientMeta, final long lastPurged) {
         final var iterator = clientMeta.getCurrentHistories().iterator();
         var metadata = iterator.next();
         while (iterator.hasNext() && metadata.getHistoryId() != 1) {
         final var iterator = clientMeta.getCurrentHistories().iterator();
         var metadata = iterator.next();
         while (iterator.hasNext() && metadata.getHistoryId() != 1) {
@@ -416,7 +416,7 @@ public class DistributedDataStoreRemotingIntegrationTest extends AbstractTest {
         assumeTrue(false);
 
         assertEquals(UnsignedLongBitmap.of(), metadata.getClosedTransactions());
         assumeTrue(false);
 
         assertEquals(UnsignedLongBitmap.of(), metadata.getClosedTransactions());
-        assertEquals("[[0.." + numCars * 2 + "]]", metadata.getPurgedTransactions().toString());
+        assertEquals("[[0.." + lastPurged + "]]", metadata.getPurgedTransactions().ranges().toString());
     }
 
     @Test
     }
 
     @Test
@@ -460,7 +460,7 @@ public class DistributedDataStoreRemotingIntegrationTest extends AbstractTest {
 
                     final var clientMeta = frontendMetadata.getClients().get(0);
                     if (leaderDistributedDataStore.getActorUtils().getDatastoreContext().isUseTellBasedProtocol()) {
 
                     final var clientMeta = frontendMetadata.getClients().get(0);
                     if (leaderDistributedDataStore.getActorUtils().getDatastoreContext().isUseTellBasedProtocol()) {
-                        assertTellClientMetadata(clientMeta, numCars);
+                        assertTellClientMetadata(clientMeta, numCars * 2 + 1);
                     } else {
                         assertAskClientMetadata(clientMeta);
                     }
                     } else {
                         assertAskClientMetadata(clientMeta);
                     }