bereng commented on a change in pull request #1342:
URL: https://github.com/apache/cassandra/pull/1342#discussion_r758961792



##########
File path: test/unit/org/apache/cassandra/utils/RecomputingSupplierTest.java
##########
@@ -93,31 +89,40 @@ public void recomputingSupplierTest() throws Throwable
                             lastSeen.accumulateAndGet(v, Math::max);
                             Assert.assertTrue(String.format("Seen %d out of 
order. Last seen value %d", v, seenBeforeGet),
                                               v >= seenBeforeGet);
-
                         }
-
                     }
                     catch (Throwable e)
                     {
                         thrown.set(e);
-                        latch.countDown();
                     }
                 }
             });
         }
 
-        latch.await(10, TimeUnit.SECONDS);
-
+        Util.spinAssertEquals(true, () -> {return counter.get() > 1;}, 11);

Review comment:
       On the waiting of 11s it is a left over of a previous approach of 10 
threads with a 1s sleep bla bla tes I was doing. So I was waiting 11s to give 
time to all 10 threads. Makes no sense now and 10 reads better, right.
   
   On the purpose of that line giving 10s of time to recompute I am not sure. 
Why not just sleep? Why wait for an exception that never happens? I never 
grasped fully that approach.




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