This is an automated email from the ASF dual-hosted git repository.

szetszwo pushed a commit to branch revert-466-RATIS-1363
in repository https://gitbox.apache.org/repos/asf/ratis.git

commit a53ed53607c61f26954aa7eb4c1ea9f2b33d4b2a
Author: Tsz-Wo Nicholas Sze <[email protected]>
AuthorDate: Sun Apr 25 17:26:52 2021 +0800

    Revert "Ratis 1363 Intermittent failure in 
TestInstallSnapshotNotificationWithGrpc (#466)"
    
    This reverts commit 37c3b13de094d31a6c674666cab07edf169d0663.
---
 .../org/apache/ratis/InstallSnapshotNotificationTests.java   | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git 
a/ratis-server/src/test/java/org/apache/ratis/InstallSnapshotNotificationTests.java
 
b/ratis-server/src/test/java/org/apache/ratis/InstallSnapshotNotificationTests.java
index 38f2e43..675ee55 100644
--- 
a/ratis-server/src/test/java/org/apache/ratis/InstallSnapshotNotificationTests.java
+++ 
b/ratis-server/src/test/java/org/apache/ratis/InstallSnapshotNotificationTests.java
@@ -275,11 +275,6 @@ public abstract class 
InstallSnapshotNotificationTests<CLUSTER extends MiniRaftC
         }
       }
 
-      // Wait until index has been updated
-      RaftTestUtil.waitFor(
-              () -> 
cluster.getLeader().getStateMachine().getLastAppliedTermIndex().getIndex() == 
20,
-               300, 15000);
-
       // Take snapshot and check result.
       long snapshotIndex = 
cluster.getLeader().getStateMachine().takeSnapshot();
       Assert.assertEquals(20, snapshotIndex);
@@ -337,10 +332,9 @@ public abstract class 
InstallSnapshotNotificationTests<CLUSTER extends MiniRaftC
 
       // Make sure leader and followers are still up to date.
       for (RaftServer.Division follower : cluster.getFollowers()) {
-        // Give follower slightly time to catch up
-        RaftTestUtil.waitFor(
-                () -> leader.getRaftLog().getNextIndex() == 
follower.getRaftLog().getNextIndex(),
-                300, 15000);
+        Assert.assertEquals(
+            leader.getRaftLog().getNextIndex(),
+            follower.getRaftLog().getNextIndex());
       }
 
       // Make sure each new peer got one snapshot notification.

Reply via email to