Skip to content

Commit

Permalink
fix(redpanda): add wait for listening port condition (#1828)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbuliarca committed Oct 27, 2023
1 parent 395fe10 commit aad7074
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/redpanda/redpanda.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,11 @@ func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomize
}

// 6. Wait until Redpanda is ready to serve requests
err = wait.ForLog("Successfully started Redpanda!").
WithPollInterval(100*time.Millisecond).
err = wait.ForAll(
wait.ForListeningPort(defaultKafkaAPIPort),
wait.ForLog("Successfully started Redpanda!").WithPollInterval(100*time.Millisecond)).
WaitUntilReady(ctx, container)

if err != nil {
return nil, fmt.Errorf("failed to wait for Redpanda readiness: %w", err)
}
Expand Down

0 comments on commit aad7074

Please sign in to comment.