Skip to content

Commit

Permalink
fix: readiness hook back off (#2718)
Browse files Browse the repository at this point in the history
Fix the definition of readiness hook back off which had the wrong
MaxElapsedTime resulting in some flaky tests.
  • Loading branch information
stevenh authored Aug 12, 2024
1 parent fc4b264 commit 8dbd4cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,15 @@ var defaultReadinessHook = func() ContainerLifecycleHooks {
func(ctx context.Context, c Container) error {
// wait until all the exposed ports are mapped:
// it will be ready when all the exposed ports are mapped,
// checking every 50ms, up to 5s, and failing if all the
// exposed ports are not mapped in that time.
// checking every 50ms, up to 1s, and failing if all the
// exposed ports are not mapped in 5s.
dockerContainer := c.(*DockerContainer)

b := backoff.NewExponentialBackOff()

b.InitialInterval = 50 * time.Millisecond
b.MaxElapsedTime = 1 * time.Second
b.MaxInterval = 5 * time.Second
b.MaxElapsedTime = 5 * time.Second
b.MaxInterval = time.Duration(float64(time.Second) * backoff.DefaultRandomizationFactor)

err := backoff.RetryNotify(
func() error {
Expand Down

0 comments on commit 8dbd4cd

Please sign in to comment.