DonalEvans commented on a change in pull request #7073:
URL: https://github.com/apache/geode/pull/7073#discussion_r741549375



##########
File path: 
geode-for-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/sortedset/ZAddIncrOptionDUnitTest.java
##########
@@ -84,25 +83,35 @@ public void tearDown() {
   @Test
   public void zAddWithIncrOptionCanAddAndIncrementScoresConcurrently() {
     new ConcurrentLoopingThreads(setSize,
-        (i) -> doZAddIncr(i, increment1, total, true),
-        (i) -> doZAddIncr(i, increment2, total, true)).run();
+        (i) -> doZAddIncr(i, increment1, total, true, false),
+        (i) -> doZAddIncr(i, increment2, total, true, false)).run();
 
     assertThat(jedis.zcard(sortedSetKey)).isEqualTo(setSize);
-    verifyZScores();
+    verifyZScores(false);
   }
 
-  private void verifyZScores() {
+  private void verifyZScores(boolean withPrimaryCrash) {
     for (int i = 0; i < setSize; i++) {
-      assertThat(jedis.zscore(sortedSetKey, baseMemberName + 
i)).isEqualTo(total);
+      if (withPrimaryCrash) {
+        assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isIn(total, 
total + increment2);
+      } else {
+        assertThat(jedis.zscore(sortedSetKey, baseMemberName + 
i)).isEqualTo(total);
+      }
     }
   }
 
-  private void doZAddIncr(int i, double increment, double total, boolean 
isConcurrentExecution) {
+  private void doZAddIncr(int i, double increment, double total, boolean 
isConcurrentExecution,
+      boolean withPrimaryCrash) {

Review comment:
       `isConcurrentExecution` and `withPrimaryCrash` seem to be mutually 
exclusive in this method. If someone tries to call this method with both set to 
true, no verification will be done at all, so maybe the if statement should 
have a branch for both being true (maybe that just throws an exception) just to 
cover all the bases?




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