wilfred-s commented on code in PR #875:
URL: https://github.com/apache/yunikorn-core/pull/875#discussion_r1621576743


##########
pkg/common/utils.go:
##########
@@ -224,6 +227,9 @@ func ZeroTimeInUnixNano(t time.Time) *int64 {
 }
 
 func WaitForCondition(eval func() bool, interval time.Duration, timeout 
time.Duration) error {
+       if interval > timeout {

Review Comment:
   Can we define a fixed error in `common.errors.go` (new file) like this:
   ```
   package common
   
   import (
        "errors"
   )
   
   var (
        // ErrorTimeout returned if waiting for a condition times out
        ErrorTimeout = errors.New("timeout waiting for condition")
   )
   ```
   That will make error chaining easy and allow using `errors.Is()` in all 
kinds of places. It would be inline with the constants definition we already 
have



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