showuon commented on a change in pull request #10932:
URL: https://github.com/apache/kafka/pull/10932#discussion_r662155569



##########
File path: raft/src/test/java/org/apache/kafka/raft/RaftEventSimulationTest.java
##########
@@ -1014,6 +1015,26 @@ public void verify() {
         }
     }
 
+    private static class LeaderNeverLoadSnapshot implements Invariant {
+        final Cluster cluster;
+
+        private LeaderNeverLoadSnapshot(Cluster cluster) {
+            this.cluster = cluster;
+        }
+
+        @Override
+        public void verify() {
+            for (RaftNode raftNode : cluster.running()) {
+                if (raftNode.counter.isWritable()) {
+                    assertEquals(0, raftNode.counter.handleSnapshotCalls());
+                } else {
+                    assertTrue(raftNode.counter.handleSnapshotCalls() >= 0);

Review comment:
       Is there any way we can make sure it's `> 0`? If we can't, I think we 
should remove this verification since the `handleSnapshotCalls` must be `>= 0` 
no matter what happened, right?




-- 
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: jira-unsubscr...@kafka.apache.org

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


Reply via email to