fix(test): Increase waiting for network time (#13613)

This commit is contained in:
Joshua Powers 2023-07-13 09:27:03 -06:00 committed by GitHub
parent b6c1f3e487
commit cd1932f031
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -302,7 +302,7 @@ func (c *Container) setupRepo() error {
// Wait for the network to come up on a container
func (c *Container) waitForNetwork() error {
var exponentialBackoffCeilingSecs int64 = 16
var exponentialBackoffCeilingSecs int64 = 128
attempts := 0
for {
@ -310,12 +310,13 @@ func (c *Container) waitForNetwork() error {
return nil
}
// uses exponetnial backoff to try after 1, 2, 4, 8, and 16 seconds
// uses exponetnial backoff to try after 1, 2, 4, 8, 16, etc. seconds
delaySecs := int64(math.Pow(2, float64(attempts)))
if delaySecs > exponentialBackoffCeilingSecs {
break
}
fmt.Printf("waiting for network, sleeping for %d second(s)\n", delaySecs)
time.Sleep(time.Duration(delaySecs) * time.Second)
attempts++
}