szetszwo commented on a change in pull request #466:
URL: https://github.com/apache/ratis/pull/466#discussion_r619138983



##########
File path: 
ratis-server/src/test/java/org/apache/ratis/InstallSnapshotNotificationTests.java
##########
@@ -332,6 +337,11 @@ private void testInstallSnapshotNotificationCount(CLUSTER 
cluster) throws Except
 
       // Make sure leader and followers are still up to date.
       for (RaftServer.Division follower : cluster.getFollowers()) {
+        long leaderIndex = leader.getRaftLog().getNextIndex();
+        // Give follower slightly time to catch up
+        RaftTestUtil.waitFor(
+                () -> leaderIndex == follower.getRaftLog().getNextIndex(),

Review comment:
       It should use leader.getRaftLog().getNextIndex() since the index may 
change.

##########
File path: 
ratis-server/src/test/java/org/apache/ratis/InstallSnapshotNotificationTests.java
##########
@@ -332,6 +337,11 @@ private void testInstallSnapshotNotificationCount(CLUSTER 
cluster) throws Except
 
       // Make sure leader and followers are still up to date.
       for (RaftServer.Division follower : cluster.getFollowers()) {
+        long leaderIndex = leader.getRaftLog().getNextIndex();
+        // Give follower slightly time to catch up
+        RaftTestUtil.waitFor(
+                () -> leaderIndex == follower.getRaftLog().getNextIndex(),
+                300, 15000);
         Assert.assertEquals(
             leader.getRaftLog().getNextIndex(),
             follower.getRaftLog().getNextIndex());

Review comment:
       We may remove this Assert since we already have waitFor.




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

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


Reply via email to