Skip to content

Conversation

@NathanBaulch
Copy link
Contributor

What does this PR do?

Removes redundant wait.ForAll calls passed to WithWaitStrategy, which already takes a variadic slice of strategies that must all pass.

Why is it important?

Improves readability and reduces indirection when debugging.

@NathanBaulch NathanBaulch requested a review from a team as a code owner October 14, 2025 01:39
@netlify
Copy link

netlify bot commented Oct 14, 2025

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit abd8969
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-go/deploys/68edc22d57820c0008298c68
😎 Deploy Preview https://deploy-preview-3449--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link

coderabbitai bot commented Oct 14, 2025

Summary by CodeRabbit

  • New Features

    • None
  • Refactor

    • Simplified container startup wait configuration across multiple modules by passing multiple wait conditions directly, reducing nesting and improving readability. No user-facing API changes.
  • Tests

    • Updated test cases to align with the new wait strategy composition without altering expected behaviors.

Walkthrough

Replaced usages of testcontainers.WithWaitStrategy(wait.ForAll(...)) by passing the individual wait strategies directly as variadic arguments to testcontainers.WithWaitStrategy(...) across tests and many modules; no exported API signatures changed and individual waits (logs, ports, HTTP/health/exec) are preserved.

Changes

Cohort / File(s) Summary of Edits
Tests
docker_test.go, network/network_test.go
Replace WithWaitStrategy(wait.ForAll(...)) with WithWaitStrategy(...), passing same wait strategies directly.
Azure
modules/azure/azurite/azurite.go, modules/azure/eventhubs/eventhubs.go, modules/azure/servicebus/servicebus.go
Remove wait.ForAll wrapper; pass multiple wait strategies directly to WithWaitStrategy.
GCloud
modules/gcloud/bigquery/bigquery.go, modules/gcloud/bigtable.go, modules/gcloud/bigtable/bigtable.go, modules/gcloud/datastore/datastore.go, modules/gcloud/firestore.go, modules/gcloud/firestore/firestore.go, modules/gcloud/pubsub.go, modules/gcloud/pubsub/pubsub.go, modules/gcloud/spanner.go, modules/gcloud/spanner/spanner.go
Convert composite wait.ForAll(...) to direct variadic WithWaitStrategy(...), preserving ports/log/HTTP waits.
Databases & storage
modules/cassandra/cassandra.go, modules/cockroachdb/cockroachdb.go, modules/mssql/mssql.go, modules/mongodb/atlaslocal/atlaslocal.go, modules/aerospike/aerospike.go
Remove ForAll; pass existing waits (listening ports, logs, exec/health) directly to WithWaitStrategy.
Messaging, gateways & middleware
modules/artemis/artemis.go, modules/consul/consul.go, modules/mockserver/mockserver.go, modules/pulsar/pulsar.go, modules/solace/solace.go, modules/openfga/openfga.go, modules/openldap/openldap.go, modules/dockermcpgateway/dockermcpgateway.go
Replace ForAll grouping with direct multi-arg WithWaitStrategy calls; adjust handling where default wait slices were used.
Other services
modules/chroma/chroma.go, modules/milvus/milvus.go, modules/neo4j/neo4j.go
Remove wait.ForAll and pass multiple waits directly to WithWaitStrategy.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Code (call sites)
    participant Run as testcontainers.Run / WithWaitStrategy
    participant WaitA as Wait Strategy A
    participant WaitB as Wait Strategy B

    Note over Dev,Run: Previous (pre-change)
    Dev->>Run: WithWaitStrategy(wait.ForAll(WaitA, WaitB))
    Run->>WaitA: start
    Run->>WaitB: start

    Note over Dev,Run: New (post-change)
    Dev->>Run: WithWaitStrategy(WaitA, WaitB)
    Run->>WaitA: start
    Run->>WaitB: start
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

chore

Suggested reviewers

  • mdelapenya
  • stevenh

Poem

I hop through lines with twitchy nose and cheer,
I swap a wrapper out so waits are clear.
Ports, logs, health checks line up in a row,
No nested ForAlls — a simpler flow.
Thump-thump — containers start, hooray! 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly describes the primary change of removing redundant wait.ForAll calls across the codebase and directly reflects the main modifications in the pull request without unnecessary detail.
Description Check ✅ Passed The description clearly explains that redundant wait.ForAll calls are removed from WithWaitStrategy and states the rationale of improved readability, which precisely aligns with the changes in the pull request.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f83c81a and abd8969.

📒 Files selected for processing (2)
  • modules/neo4j/neo4j.go (1 hunks)
  • modules/pulsar/pulsar.go (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • modules/pulsar/pulsar.go
  • modules/neo4j/neo4j.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
  • GitHub Check: lint (modules/k3s) / lint: modules/k3s
  • GitHub Check: lint (modules/arangodb) / lint: modules/arangodb
  • GitHub Check: lint (modules/neo4j) / lint: modules/neo4j
  • GitHub Check: lint (modules/dockermodelrunner) / lint: modules/dockermodelrunner
  • GitHub Check: lint (modules/cockroachdb) / lint: modules/cockroachdb
  • GitHub Check: lint (modules/postgres) / lint: modules/postgres
  • GitHub Check: lint (modules/mariadb) / lint: modules/mariadb
  • GitHub Check: lint (modules/influxdb) / lint: modules/influxdb
  • GitHub Check: lint (modules/localstack) / lint: modules/localstack
  • GitHub Check: lint (modules/dolt) / lint: modules/dolt
  • GitHub Check: lint (modules/nats) / lint: modules/nats
  • GitHub Check: lint (modules/azurite) / lint: modules/azurite
  • GitHub Check: lint (modules/openfga) / lint: modules/openfga
  • GitHub Check: lint (modules/weaviate) / lint: modules/weaviate
  • GitHub Check: lint (modules/meilisearch) / lint: modules/meilisearch
  • GitHub Check: lint (modules/milvus) / lint: modules/milvus
  • GitHub Check: lint (modules/surrealdb) / lint: modules/surrealdb
  • GitHub Check: lint (modules/minio) / lint: modules/minio
  • GitHub Check: Analyze (go)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
modules/pulsar/pulsar.go (1)

24-31: Consider removing the ForAll wrapper from defaultWaitStrategies.

At line 24, defaultWaitStrategies is still defined using wait.ForAll, and at line 147 it's passed directly to WithWaitStrategy(defaultWaitStrategies). For consistency with this PR's goal, consider:

-var defaultWaitStrategies = wait.ForAll(
-	wait.ForHTTP("/admin/v2/clusters").WithPort(defaultPulsarAdminPort).WithResponseMatcher(func(r io.Reader) bool {
-		respBytes, _ := io.ReadAll(r)
-		resp := string(respBytes)
-		return resp == `["standalone"]`
-	}),
-	wait.ForLog("Successfully updated the policies on namespace public/default"),
-)
+var (
+	defaultHTTPWait = wait.ForHTTP("/admin/v2/clusters").WithPort(defaultPulsarAdminPort).WithResponseMatcher(func(r io.Reader) bool {
+		respBytes, _ := io.ReadAll(r)
+		resp := string(respBytes)
+		return resp == `["standalone"]`
+	})
+	defaultLogWait = wait.ForLog("Successfully updated the policies on namespace public/default")
+)

Then at line 147:

-		testcontainers.WithWaitStrategy(defaultWaitStrategies),
+		testcontainers.WithWaitStrategy(defaultHTTPWait, defaultLogWait),

And update lines 83 and 123:

-	ss = append(ss, defaultWaitStrategies.Strategies...)
+	ss = append(ss, defaultHTTPWait, defaultLogWait)

This would eliminate the ForAll wrapper entirely from this module.

Also applies to: 147-147

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ae0c648 and 1137ad1.

📒 Files selected for processing (30)
  • docker_test.go (5 hunks)
  • modules/aerospike/aerospike.go (1 hunks)
  • modules/artemis/artemis.go (1 hunks)
  • modules/azure/azurite/azurite.go (1 hunks)
  • modules/azure/eventhubs/eventhubs.go (1 hunks)
  • modules/azure/servicebus/servicebus.go (1 hunks)
  • modules/cassandra/cassandra.go (1 hunks)
  • modules/chroma/chroma.go (1 hunks)
  • modules/cockroachdb/cockroachdb.go (2 hunks)
  • modules/consul/consul.go (1 hunks)
  • modules/dockermcpgateway/dockermcpgateway.go (1 hunks)
  • modules/gcloud/bigquery/bigquery.go (1 hunks)
  • modules/gcloud/bigtable.go (1 hunks)
  • modules/gcloud/bigtable/bigtable.go (1 hunks)
  • modules/gcloud/datastore/datastore.go (1 hunks)
  • modules/gcloud/firestore.go (1 hunks)
  • modules/gcloud/firestore/firestore.go (1 hunks)
  • modules/gcloud/pubsub.go (1 hunks)
  • modules/gcloud/pubsub/pubsub.go (1 hunks)
  • modules/gcloud/spanner.go (1 hunks)
  • modules/gcloud/spanner/spanner.go (1 hunks)
  • modules/milvus/milvus.go (2 hunks)
  • modules/mockserver/mockserver.go (1 hunks)
  • modules/mongodb/atlaslocal/atlaslocal.go (1 hunks)
  • modules/mssql/mssql.go (1 hunks)
  • modules/openfga/openfga.go (2 hunks)
  • modules/openldap/openldap.go (1 hunks)
  • modules/pulsar/pulsar.go (2 hunks)
  • modules/solace/solace.go (1 hunks)
  • network/network_test.go (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: mdelapenya
PR: testcontainers/testcontainers-go#3319
File: modules/arangodb/arangodb.go:46-57
Timestamp: 2025-09-29T13:57:14.636Z
Learning: In testcontainers-go ArangoDB module, the wait strategy combines port listening check with HTTP readiness check using wait.ForAll - both strategies are required and complementary, not redundant.
📚 Learning: 2025-09-29T13:57:14.636Z
Learnt from: mdelapenya
PR: testcontainers/testcontainers-go#3319
File: modules/arangodb/arangodb.go:46-57
Timestamp: 2025-09-29T13:57:14.636Z
Learning: In testcontainers-go ArangoDB module, the wait strategy combines port listening check with HTTP readiness check using wait.ForAll - both strategies are required and complementary, not redundant.

Applied to files:

  • modules/dockermcpgateway/dockermcpgateway.go
  • modules/cockroachdb/cockroachdb.go
  • modules/gcloud/spanner/spanner.go
  • modules/cassandra/cassandra.go
  • modules/gcloud/spanner.go
  • modules/gcloud/datastore/datastore.go
  • modules/openfga/openfga.go
  • modules/azure/servicebus/servicebus.go
  • modules/gcloud/pubsub/pubsub.go
  • docker_test.go
  • modules/milvus/milvus.go
  • modules/mongodb/atlaslocal/atlaslocal.go
  • modules/gcloud/firestore/firestore.go
  • modules/pulsar/pulsar.go
  • modules/gcloud/firestore.go
  • modules/artemis/artemis.go
  • modules/openldap/openldap.go
  • network/network_test.go
  • modules/mockserver/mockserver.go
  • modules/gcloud/bigtable.go
  • modules/mssql/mssql.go
  • modules/gcloud/bigquery/bigquery.go
  • modules/consul/consul.go
  • modules/aerospike/aerospike.go
  • modules/azure/azurite/azurite.go
🧬 Code graph analysis (30)
modules/dockermcpgateway/dockermcpgateway.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/log.go (1)
  • ForLog (118-120)
modules/cockroachdb/cockroachdb.go (1)
options.go (1)
  • WithWaitStrategy (366-368)
modules/gcloud/spanner/spanner.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/log.go (1)
  • ForLog (118-120)
modules/gcloud/bigtable/bigtable.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/log.go (1)
  • ForLog (118-120)
modules/cassandra/cassandra.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/exec.go (1)
  • ForExec (71-73)
modules/gcloud/spanner.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/log.go (1)
  • ForLog (118-120)
modules/gcloud/datastore/datastore.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/http.go (1)
  • ForHTTP (149-151)
modules/openfga/openfga.go (1)
options.go (1)
  • WithWaitStrategy (366-368)
modules/azure/servicebus/servicebus.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/http.go (1)
  • ForHTTP (149-151)
modules/gcloud/pubsub/pubsub.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/log.go (1)
  • ForLog (118-120)
docker_test.go (4)
options.go (1)
  • WithWaitStrategy (366-368)
wait/log.go (1)
  • ForLog (118-120)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/http.go (1)
  • ForHTTP (149-151)
modules/milvus/milvus.go (1)
options.go (1)
  • WithWaitStrategy (366-368)
modules/mongodb/atlaslocal/atlaslocal.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/health.go (1)
  • ForHealthCheck (55-57)
modules/azure/eventhubs/eventhubs.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/http.go (1)
  • ForHTTP (149-151)
modules/chroma/chroma.go (4)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/log.go (1)
  • ForLog (118-120)
wait/http.go (1)
  • ForHTTP (149-151)
modules/gcloud/firestore/firestore.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/log.go (1)
  • ForLog (118-120)
modules/pulsar/pulsar.go (1)
options.go (1)
  • WithWaitStrategy (366-368)
modules/gcloud/firestore.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/log.go (1)
  • ForLog (118-120)
modules/artemis/artemis.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/log.go (1)
  • ForLog (118-120)
modules/gcloud/pubsub.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/log.go (1)
  • ForLog (118-120)
modules/openldap/openldap.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/log.go (1)
  • ForLog (118-120)
wait/host_port.go (1)
  • ForListeningPort (67-69)
modules/solace/solace.go (1)
options.go (1)
  • WithWaitStrategy (366-368)
network/network_test.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/log.go (1)
  • ForLog (118-120)
modules/mockserver/mockserver.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/log.go (1)
  • ForLog (118-120)
wait/host_port.go (1)
  • ForListeningPort (67-69)
modules/gcloud/bigtable.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/log.go (1)
  • ForLog (118-120)
modules/mssql/mssql.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/log.go (1)
  • ForLog (118-120)
modules/gcloud/bigquery/bigquery.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/host_port.go (1)
  • ForListeningPort (67-69)
wait/http.go (1)
  • ForHTTP (149-151)
modules/consul/consul.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/log.go (1)
  • ForLog (118-120)
wait/host_port.go (1)
  • ForListeningPort (67-69)
modules/aerospike/aerospike.go (3)
options.go (1)
  • WithWaitStrategy (366-368)
wait/log.go (1)
  • ForLog (118-120)
wait/host_port.go (1)
  • ForListeningPort (67-69)
modules/azure/azurite/azurite.go (1)
options.go (1)
  • WithWaitStrategy (366-368)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
  • GitHub Check: lint (modules/inbucket) / lint: modules/inbucket
  • GitHub Check: lint (modules/elasticsearch) / lint: modules/elasticsearch
  • GitHub Check: lint (modules/redpanda) / lint: modules/redpanda
  • GitHub Check: lint (modules/nats) / lint: modules/nats
  • GitHub Check: lint (modules/dolt) / lint: modules/dolt
  • GitHub Check: lint (modules/grafana-lgtm) / lint: modules/grafana-lgtm
  • GitHub Check: lint (modules/nebulagraph) / lint: modules/nebulagraph
  • GitHub Check: lint (modules/vearch) / lint: modules/vearch
  • GitHub Check: lint (modules/openfga) / lint: modules/openfga
  • GitHub Check: lint (modules/localstack) / lint: modules/localstack
  • GitHub Check: lint (modules/azurite) / lint: modules/azurite
  • GitHub Check: lint (modules/dynamodb) / lint: modules/dynamodb
  • GitHub Check: lint (modules/rabbitmq) / lint: modules/rabbitmq
  • GitHub Check: lint (modules/mysql) / lint: modules/mysql
  • GitHub Check: lint (modules/clickhouse) / lint: modules/clickhouse
  • GitHub Check: lint (modules/milvus) / lint: modules/milvus
  • GitHub Check: lint (modules/pulsar) / lint: modules/pulsar
  • GitHub Check: Analyze (go)
🔇 Additional comments (32)
modules/gcloud/spanner.go (1)

21-24: LGTM!

The refactor correctly removes the redundant wait.ForAll wrapper while preserving both wait conditions (port listening + log message). Since WithWaitStrategy accepts variadic strategies, passing them directly is functionally equivalent to wrapping them in ForAll, but improves readability by reducing indirection.

modules/gcloud/bigquery/bigquery.go (1)

46-51: LGTM! Correctly removes redundant wait.ForAll wrapper.

The refactor preserves both wait strategies (port listening and HTTP readiness) while simplifying composition. Since WithWaitStrategy accepts variadic strategies that must all pass, the wait.ForAll wrapper was redundant. This improves readability and reduces indirection.

modules/aerospike/aerospike.go (1)

37-42: LGTM!

The removal of wait.ForAll wrapper is correct. WithWaitStrategy already accepts variadic strategies that must all pass, so the wrapper was redundant. The change improves readability by removing unnecessary indirection.

modules/gcloud/spanner/spanner.go (1)

39-42: LGTM!

The removal of wait.ForAll wrapper is correct. Both wait strategies (port listening and log check) are now passed directly to WithWaitStrategy, which already requires all strategies to pass.

modules/gcloud/pubsub.go (1)

21-24: LGTM!

The removal of wait.ForAll wrapper is correct. Even though this function is deprecated, the refactor maintains consistency and improves code clarity.

modules/azure/azurite/azurite.go (1)

103-103: LGTM!

The removal of wait.ForAll wrapper is correct. The dynamically constructed waitingFor slice is now spread directly into WithWaitStrategy, which already handles the "all must pass" semantics.

modules/gcloud/firestore/firestore.go (1)

55-58: LGTM!

The removal of wait.ForAll wrapper is correct. Both wait strategies are now passed directly to WithWaitStrategy, simplifying the code without changing behavior.

modules/solace/solace.go (1)

61-61: LGTM!

The removal of wait.ForAll wrapper is correct. The dynamically constructed waitStrategies slice (containing the primary exec check plus port-based waits for each service) is now spread directly into WithWaitStrategy.

modules/consul/consul.go (1)

64-67: LGTM!

The removal of wait.ForAll wrapper is correct. Both wait strategies (log check and port listening) are now passed directly to WithWaitStrategy, improving code clarity.

modules/gcloud/bigtable/bigtable.go (1)

39-42: LGTM!

The removal of wait.ForAll wrapper is correct. Both wait strategies are now passed directly to WithWaitStrategy, which already requires all strategies to pass.

modules/azure/servicebus/servicebus.go (1)

94-100: LGTM! Wait strategy composition simplified correctly.

The change removes the redundant wait.ForAll wrapper while preserving all three wait conditions (two port checks and one HTTP health check). Since WithWaitStrategy already requires all variadic strategies to pass, this improves readability without altering behavior.

modules/milvus/milvus.go (1)

62-71: LGTM! Multi-port wait strategy simplified correctly.

The change removes the wait.ForAll wrapper while maintaining all three wait conditions (HTTP health check on port 9091, and listening checks on both HTTP and gRPC ports). All timeout and poll interval configurations are preserved.

modules/chroma/chroma.go (1)

26-32: LGTM! Chroma wait strategy composition streamlined.

The change removes the redundant wait.ForAll wrapper while keeping all three wait conditions intact (port listening, log message, and HTTP heartbeat check).

modules/mongodb/atlaslocal/atlaslocal.go (1)

39-39: LGTM! MongoDB Atlas Local wait strategy simplified.

The change removes the wait.ForAll wrapper, passing the port listening and health check strategies directly to WithWaitStrategy. Both conditions must still pass.

modules/azure/eventhubs/eventhubs.go (1)

86-92: LGTM! Event Hubs wait strategy composition streamlined.

The change removes the redundant wait.ForAll wrapper while preserving all three wait conditions (AMQP port, HTTP port, and HTTP health endpoint). The multi-port readiness check remains intact.

modules/pulsar/pulsar.go (2)

85-85: LGTM! Functions worker wait strategy unwrapped correctly.

The change correctly unwraps the individual strategies from defaultWaitStrategies.Strategies and passes them along with the function worker log check directly to WithWaitStrategy.


125-125: LGTM! Transactions wait strategy unwrapped correctly.

The change correctly unwraps the individual strategies from defaultWaitStrategies.Strategies and passes them along with the transaction coordinator check directly to WithWaitStrategy.

modules/gcloud/bigtable.go (1)

21-24: LGTM! BigTable wait strategy simplified.

The change removes the wait.ForAll wrapper, passing the port listening and log readiness checks directly to WithWaitStrategy.

modules/cassandra/cassandra.go (1)

84-90: LGTM! Cassandra wait strategy composition streamlined.

The change removes the redundant wait.ForAll wrapper while preserving both wait conditions: port listening and bootstrap completion check via cqlsh. The response matcher logic remains intact.

modules/gcloud/datastore/datastore.go (1)

39-42: LGTM! Cleaner wait strategy composition.

The refactor correctly removes the redundant wait.ForAll wrapper while preserving both wait conditions (listening port and HTTP readiness). Since WithWaitStrategy accepts variadic strategies that all must pass, the explicit ForAll wrapper was unnecessary.

modules/gcloud/firestore.go (1)

21-24: LGTM! Simplified wait strategy composition.

The change correctly removes the redundant wait.ForAll wrapper while maintaining both wait conditions (listening port and log message). The behavior remains identical since WithWaitStrategy inherently requires all variadic strategies to pass.

modules/gcloud/pubsub/pubsub.go (1)

39-42: LGTM! Cleaner wait strategy declaration.

The refactor properly removes the redundant wait.ForAll wrapper while preserving both wait conditions (listening port and log message). This improves readability without changing behavior.

modules/mockserver/mockserver.go (1)

26-29: LGTM! Simplified wait strategy composition.

The change correctly eliminates the redundant wait.ForAll wrapper while maintaining both wait conditions (log message and listening port with internal check skipped). The refactor improves code clarity.

modules/dockermcpgateway/dockermcpgateway.go (1)

56-59: LGTM! Cleaner wait strategy declaration.

The refactor correctly removes the redundant wait.ForAll wrapper while preserving both wait conditions (listening port and regex log pattern). This simplification improves readability without affecting behavior.

modules/openfga/openfga.go (1)

55-67: LGTM! Simplified wait strategy composition.

The change correctly removes the redundant wait.ForAll wrapper while maintaining both HTTP readiness checks (health endpoint on port 8080 and playground endpoint on port 3000). The refactor improves code clarity without altering functionality.

modules/mssql/mssql.go (1)

117-120: LGTM! Cleaner wait strategy declaration.

The refactor properly eliminates the redundant wait.ForAll wrapper while preserving both wait conditions (listening port with timeout and recovery completion log). This improves readability and reduces indirection during debugging.

modules/openldap/openldap.go (1)

121-124: LGTM! Simplified wait strategy composition.

The change correctly removes the redundant wait.ForAll wrapper while preserving both required wait conditions (slapd startup log and listening port). Since WithWaitStrategy accepts variadic strategies that all must pass, both conditions remain complementary and required as intended. Based on learnings.

modules/artemis/artemis.go (1)

106-111: LGTM! Cleaner wait strategy composition.

The removal of wait.ForAll reduces indirection while preserving the same wait semantics. WithWaitStrategy already ensures all strategies must pass.

modules/cockroachdb/cockroachdb.go (1)

194-208: LGTM! Simplified wait strategy composition.

The change correctly removes the redundant wait.ForAll wrapper while preserving all four wait conditions (file, HTTP health check, TLS cert, and SQL readiness). This improves code clarity without altering behavior.

network/network_test.go (1)

143-146: LGTM! Consistent with repository-wide refactor.

Removing the wait.ForAll wrapper simplifies the wait strategy composition while maintaining the same behavior (waiting for both port and log).

docker_test.go (2)

607-610: LGTM! Consistent refactor across test suite.

The removal of wait.ForAll wrapper aligns with the repository-wide changes and maintains the same wait behavior.


649-651: LGTM! Simplified single-strategy wait conditions.

Removing the wait.ForAll wrapper even for single strategies improves consistency and eliminates unnecessary nesting. The variadic WithWaitStrategy handles both single and multiple strategies uniformly.

Also applies to: 668-670, 687-689, 1434-1440

@mdelapenya mdelapenya requested a review from Copilot October 14, 2025 05:26
@mdelapenya mdelapenya self-assigned this Oct 14, 2025
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Oct 14, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes redundant wait.ForAll wrapper calls when using WithWaitStrategy, since the function already accepts a variadic slice of strategies and waits for all of them to pass. This change improves code readability by eliminating unnecessary indirection.

  • Removes wait.ForAll wrapper from multiple WithWaitStrategy calls across test and module files
  • Converts variable declarations from wait.ForAll() to slice literals where applicable
  • Updates function calls to pass strategies directly as variadic arguments

Reviewed Changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated no comments.

Show a summary per file
File Description
network/network_test.go Removes wait.ForAll wrapper in test configuration
modules/*/*.go Removes redundant wait.ForAll calls in 25+ module files
docker_test.go Updates test cases to use direct strategy passing
modules/pulsar/pulsar.go Changes variable type from wait.ForAll to slice and updates usage
modules/neo4j/neo4j.go Replaces wait.MultiStrategy with direct strategy passing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I was actually thinking about this refactor, as I noticed the initial pass of the "use Run function" PRs added it, although the latter ones did remove it, so thank you so much for anticipating this work.

@mdelapenya mdelapenya merged commit 703d057 into testcontainers:main Oct 14, 2025
213 checks passed
@NathanBaulch NathanBaulch deleted the waitforall branch October 14, 2025 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Changes that do not impact the existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants