maedhroz commented on code in PR #3305:
URL: https://github.com/apache/cassandra/pull/3305#discussion_r1614015203


##########
test/distributed/org/apache/cassandra/distributed/test/accord/AccordMigrationTest.java:
##########
@@ -696,6 +705,27 @@ private static void assertMigrationState(String tableName, 
ConsensusMigrationTar
         });
     }
 
+    private static void assertVtableMigrationState(String tableName, 
List<Range<Token>> migratedRanges, List<Range<Token>> migratingRanges) throws 
JsonProcessingException
+    {
+        SimpleQueryResult vtableResult =
+            SHARED_CLUSTER.get(1).executeInternalWithResult("SELECT * FROM 
system_views.accord_migration_state WHERE table_name = ?", tableName);
+        assertTrue(vtableResult.hasNext());
+        Row tableState = vtableResult.next();
+        List<String> vtableMigratedRanges = 
tableState.getList("migrated_ranges");
+        assertEquals(migratedRanges, 
vtableMigratedRanges.stream().map(Range::fromString).collect(Collectors.toList()));

Review Comment:
   @aweisberg It looks like this assertion is a bit flakey. I haven't been able 
to reproduce locally, but a couple times in CI...
   
   ```
   junit.framework.AssertionFailedError: expected:<[]>  but 
was:<[(-1,9223372036854775807]]>
        at 
org.apache.cassandra.distributed.test.accord.AccordMigrationTest.assertVtableMigrationState(AccordMigrationTest.java:715)
        at 
org.apache.cassandra.distributed.test.accord.AccordMigrationTest.assertMigrationState(AccordMigrationTest.java:633)
        at 
org.apache.cassandra.distributed.test.accord.AccordMigrationTest.lambda$testPaxosToAccordCAS$13(AccordMigrationTest.java:404)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to