zhaijack opened a new issue #751: create assertEventuallyEquals for unit test
URL: https://github.com/apache/bookkeeper/issues/751
 
 
   
   **FEATURE REQUEST**
   
   1. Please describe the feature you are requesting.
   in unit test, some times, it is not avoidable to use sleep, then do the 
assert.  This sleep should not wait too much long. 
   
   2. Indicate the importance of this issue to you (blocker, must-have, 
should-have, nice-to-have). Are you currently using any workarounds to address 
this issue?
   should-have
   
   3. Provide any additional detail on your proposed use case for this feature.
   we could create a utility method in TestUtils, to do this kind of work:
   ```
   assertEventuallyEquals(x, y, timeout, units) {
        long maxMillis = units.toMiliis(timeout);
        while (x != y && maxMillis > 0) {
            maxMillis -= 10;
            Thread.sleep(10);
       }
       assertEquals(x, y);
   }
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to