refactor(test): use the built-in max/min to simplify the code (#4576)

Signed-off-by: tsinglua <tsinglua@outlook.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
tsinglua 2026-03-13 22:42:00 +08:00 committed by GitHub
parent 48667a2dd1
commit 6d880724cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,10 +49,7 @@ func waitForServerReady(url string, maxAttempts int) error {
}
// Exponential backoff: 10ms, 20ms, 40ms, 80ms, 160ms...
backoff := time.Duration(10*(1<<uint(i))) * time.Millisecond
if backoff > 500*time.Millisecond {
backoff = 500 * time.Millisecond
}
backoff := min(time.Duration(10*(1<<uint(i)))*time.Millisecond, 500*time.Millisecond)
time.Sleep(backoff)
}