rpuch commented on code in PR #2778:
URL: https://github.com/apache/ignite-3/pull/2778#discussion_r1380053817


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteInMemoryNodeRestartTest.java:
##########
@@ -195,31 +200,29 @@ public void inMemoryNodeRestartNotLeader(TestInfo 
testInfo) throws Exception {
         InternalTableImpl internalTable = (InternalTableImpl) 
restartingTable.internalTable();
 
         // Check that it restarts.
-        assertTrue(waitForCondition(
-                () -> {
-                    boolean raftNodeStarted = 
loza.localNodes().stream().anyMatch(nodeId -> {
-                        if (nodeId.groupId() instanceof TablePartitionId) {
-                            return ((TablePartitionId) 
nodeId.groupId()).tableId() == table.tableId();
-                        }
+        waitForCondition(
+                () -> isRaftNodeStarted(table, loza) && 
assignmentsContain(restartingNodeConsistentId, internalTable),
+                TimeUnit.SECONDS.toMillis(10)
+        );
 
-                        return false;
-                    });
+        assertTrue(isRaftNodeStarted(table, loza), "Raft node is not started");
+        assertTrue(assignmentsContain(restartingNodeConsistentId, 
internalTable), "Assignments do not contain the node");
 
-                    if (!raftNodeStarted) {
-                        return false;
-                    }
+        // Check the data rebalanced correctly.
+        checkTableWithData(restartingNode, TABLE_NAME);
+    }
 
-                    Map<Integer, List<String>> assignments = 
internalTable.peersAndLearners();
+    private static boolean assignmentsContain(String 
restartingNodeConsistentId, InternalTableImpl internalTable) {
+        Map<Integer, List<String>> assignments = 
internalTable.peersAndLearners();
 
-                    List<String> partitionAssignments = assignments.get(0);
+        List<String> partitionAssignments = assignments.get(0);

Review Comment:
   Because there is only one partition



-- 
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]

Reply via email to