vldpyatkov commented on code in PR #5475:
URL: https://github.com/apache/ignite-3/pull/5475#discussion_r2011588398


##########
modules/raft/src/integrationTest/java/org/apache/ignite/raft/jraft/core/ItNodeTest.java:
##########
@@ -827,14 +831,16 @@ public void testSingleNodeWithLearner() throws Exception {
 
             assertEquals(1, node.listPeers().size());
             assertTrue(node.listPeers().contains(peer.getPeerId()));
-            assertTrue(waitForCondition(() -> node.isLeader(), 1_000));
+            assertTrue(waitForCondition(node::isLeader, 1_000));
 
             sendTestTaskAndWait(node, cnt);
             assertEquals(cnt, fsm.getLogs().size());
             int i = 0;
             for (ByteBuffer data : fsm.getLogs())
                 assertEquals("hello" + i++, stringFromBytes(data.array()));
-            Thread.sleep(1000); //wait for entries to be replicated to learner.
+            // Wait for entries to be replicated to learner. The value is 
selected according to the period of sending accumulated messages
+            // in NodeManager.
+            Thread.sleep(nodeOptions.getElectionTimeoutMs());

Review Comment:
   I believe sleeping is not the right way for our tests.
   Probably, we can skip this sleep and use waitForCondition to check a log 
size after shutdown.



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to