jyothsnakonisa commented on code in PR #4537:
URL: https://github.com/apache/cassandra/pull/4537#discussion_r2636632029


##########
test/unit/org/apache/cassandra/service/RetryStrategyTest.java:
##########
@@ -64,6 +69,26 @@ public void fuzzParser()
         });
     }
 
+    @Test
+    public void testSeededWaitRandomizer()
+    {
+        long wait1 = generateSeededWait(100);
+        long wait2 = generateSeededWait(100);
+        Assertions.assertThat(wait1).isEqualTo(wait2);
+
+        long wait3 = generateSeededWait(200);
+        Assertions.assertThat(wait1).isNotEqualTo(wait3);

Review Comment:
   This test is not validating the change that you made in the patch. how about 
changing it to something like this
   ```suggestion
           RetrySpec spec = new RetrySpec(new RetrySpec.MaxAttempt(10),
                                          new 
DurationSpec.LongMillisecondsBound("200ms"),
                                          new 
DurationSpec.LongMillisecondsBound("1000ms"));
   
           long wait1 = RetrySpec.toStrategy(createContext(100), 
spec).computeWait(1, TimeUnit.MILLISECONDS);
           long wait2 = RetrySpec.toStrategy(createContext(100), 
spec).computeWait(1, TimeUnit.MILLISECONDS);
           long wait3 = RetrySpec.toStrategy(createContext(200), 
spec).computeWait(1, TimeUnit.MILLISECONDS);
   
           Assertions.assertThat(wait1).isEqualTo(wait2);
           Assertions.assertThat(wait1).isNotEqualTo(wait3);
   ```
   



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to