zymap commented on code in PR #3581:
URL: https://github.com/apache/bookkeeper/pull/3581#discussion_r1006322278


##########
bookkeeper-server/src/test/java/org/apache/bookkeeper/client/SlowBookieTest.java:
##########
@@ -419,11 +419,9 @@ public void testWaitForWritable() throws Exception {
             final long timeout = 10000;
 
             // waitForWritable async
-           new Thread(() -> {
-                isWriteable.set(lh.waitForWritable(writeSet, 0, timeout));
-            }).start();
-            TimeUnit.MILLISECONDS.sleep(5000);
-            assertFalse(isWriteable.get());
+            new Thread(() -> isWriteable.set(lh.waitForWritable(writeSet, 0, 
timeout))).start();
+
+            Awaitility.await().untilAsserted(() -> 
assertFalse(isWriteable.get()));

Review Comment:
   ```suggestion
               Awaitility.await().pollDelay(5, 
TimeUnit.SECONDS).untilAsserted(() -> assertFalse(isWriteable.get()));
   ```
   
   Because the isWritable is false from the beginning, we want to wait a moment 
to verify it still in `waitForWritable` backoff



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