sashapolo commented on PR #4990:
URL: https://github.com/apache/ignite-3/pull/4990#issuecomment-2572642849

   I would like to stress the difference between `waitForCondition` and 
`assertTimeoutPreemptively` (or `@Timeout` in this case):
   
   1. `waitForCondition` executes the given predicate *multiple* times until 
either the condition is satisfied or a time limit reached.
   2. `assertTimeoutPreemptively` executes the given statement *once* and waits 
for it to complete in a given time period.
   
   If we are getting exceptions when executing `waitForCondition` it does not 
mean that the predicate inside it got stuck for some reason, it means that the 
predicate did not return `true` during all attempts. Therefore, replacing 
`waitForCondition` with `assertTimeoutPreemptively` is equivalent to just 
calling the predicate inside `waitForCondition` just once. So, to me, your 
proposed changes do not solve any problems related to the test correctness. 
   
   If you are instead trying to improve the error message, then you can just 
add a better error message to the `assertTrue` statement.


-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to