chore(pulsar): bump base image to 4.x, replacing the wait for log strategy with wait for listening port (deterministic)#3573
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary by CodeRabbit
WalkthroughThe Pulsar module is updated to use container image version 4.0.9 instead of 2.10.2 across documentation, examples, and tests. The module's waiting strategy is changed from checking log messages to listening on the Pulsar port. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
modules/pulsar/pulsar.go (1)
24-31:⚠️ Potential issue | 🟠 MajorDon't replace broker readiness with a socket-open check.
wait.ForListeningPort(defaultPulsarPort)only proves that6650/tcpis accepting TCP connections. It does not prove the Pulsar broker is ready for client operations, soRuncan return while producers/consumers still race the broker startup path. Please keep a broker-level readiness signal here as well (the previous log wait, or another application-level probe) and use the port check as an additional deterministic guard instead of a replacement.Based on learnings: 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.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@modules/pulsar/pulsar.go` around lines 24 - 31, The current defaultWaitStrategies replaced an application-level readiness probe with only wait.ForListeningPort(defaultPulsarPort); restore an application-level broker readiness check alongside the socket check by composing the HTTP admin probe (the existing wait.ForHTTP("/admin/v2/clusters").WithPort(defaultPulsarAdminPort).WithResponseMatcher(...)) and the port probe using wait.ForAll so both must succeed; update the defaultWaitStrategies slice to use wait.ForAll(...) containing the HTTP readiness strategy and wait.ForListeningPort(defaultPulsarPort) (keep the existing response matcher and port settings) so Run only returns after both application-level and TCP readiness are satisfied.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@modules/pulsar/pulsar.go`:
- Around line 24-31: The current defaultWaitStrategies replaced an
application-level readiness probe with only
wait.ForListeningPort(defaultPulsarPort); restore an application-level broker
readiness check alongside the socket check by composing the HTTP admin probe
(the existing
wait.ForHTTP("/admin/v2/clusters").WithPort(defaultPulsarAdminPort).WithResponseMatcher(...))
and the port probe using wait.ForAll so both must succeed; update the
defaultWaitStrategies slice to use wait.ForAll(...) containing the HTTP
readiness strategy and wait.ForListeningPort(defaultPulsarPort) (keep the
existing response matcher and port settings) so Run only returns after both
application-level and TCP readiness are satisfied.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f2548de0-8adf-44d3-8e79-d44771fda3da
📒 Files selected for processing (4)
docs/modules/pulsar.mdmodules/pulsar/examples_test.gomodules/pulsar/pulsar.gomodules/pulsar/pulsar_test.go
* main: chore(pulsar): bump base image to 4.x, replacing the wait for log strategy with wait for listening port (deterministic) (testcontainers#3573) chore(deps): bump github.com/sigstore/sigstore in /modules/compose (testcontainers#3571)
…m-v2 * upstream/main: (269 commits) chore(deps): bump actions/checkout from 6.0.1 to 6.0.2 (#3560) chore(deps): bump go.opentelemetry.io/otel/sdk to v1.41.0 (#3589) feat: add TiDB module (#3575) feat: add Forgejo module (#3556) feat: improve container conflict detection (#3574) chore(deps): bump go to 1.25 everywhere (#3572) chore(pulsar): bump base image to 4.x, replacing the wait for log strategy with wait for listening port (deterministic) (#3573) chore(deps): bump github.com/sigstore/sigstore in /modules/compose (#3571) chore(compose): update to compose-v5 (#3568) chore(deps): bump github.com/modelcontextprotocol/go-sdk (#3557) chore(deps): bump mkdocs-codeinclude-plugin from 0.2.1 to 0.3.1 (#3561) chore: update usage metrics (2026-03-02) (#3565) chore(deps): bump mkdocs-include-markdown-plugin from 7.2.0 to 7.2.1 (#3562) chore(deps): bump go.opentelemetry.io/otel/sdk in /modules/grafana-lgtm (#3563) chore(deps): bump go.opentelemetry.io/otel/sdk in /modules/toxiproxy (#3564) feat(azure): add lowkey vault container (#3542) feat(chroma): update to chroma 1.x (#3552) chore(deps): bump mkdocs-include-markdown-plugin from 7.2.0 to 7.2.1 (#3547) chore(deps): bump tj-actions/changed-files from 47.0.0 to 47.0.1 (#3546) chore(deps): bump actions/upload-artifact from 4.6.2 to 6.0.0 (#3545) ...
…archive-temp * upstream/main: chore(deps): bump actions/checkout from 6.0.1 to 6.0.2 (#3560) chore(deps): bump go.opentelemetry.io/otel/sdk to v1.41.0 (#3589) feat: add TiDB module (#3575) feat: add Forgejo module (#3556) feat: improve container conflict detection (#3574) chore(deps): bump go to 1.25 everywhere (#3572) chore(pulsar): bump base image to 4.x, replacing the wait for log strategy with wait for listening port (deterministic) (#3573) chore(deps): bump github.com/sigstore/sigstore in /modules/compose (#3571) chore(compose): update to compose-v5 (#3568) chore(deps): bump github.com/modelcontextprotocol/go-sdk (#3557) chore(deps): bump mkdocs-codeinclude-plugin from 0.2.1 to 0.3.1 (#3561) chore: update usage metrics (2026-03-02) (#3565) chore(deps): bump mkdocs-include-markdown-plugin from 7.2.0 to 7.2.1 (#3562) chore(deps): bump go.opentelemetry.io/otel/sdk in /modules/grafana-lgtm (#3563) chore(deps): bump go.opentelemetry.io/otel/sdk in /modules/toxiproxy (#3564)
…-action * upstream/main: (22 commits) chore(deps): bump golang.org/x/mod in /modules/localstack (#3587) chore(deps): bump golang.org/x/mod in /modules/elasticsearch (#3585) chore(deps): bump golang.org/x/mod in /modules/redpanda (#3588) chore(deps): bump golang.org/x/mod in /modules/kafka (#3586) chore(deps): bump github.com/shirou/gopsutil/v4 from 4.25.12 to 4.26.2 (#3576) chore(deps): bump github.com/moby/go-archive from 0.1.0 to 0.2.0 (#3548) chore(deps): bump github.com/moby/term from 0.5.0 to 0.5.2 (#3081) chore(deps): bump actions/checkout from 6.0.1 to 6.0.2 (#3560) chore(deps): bump go.opentelemetry.io/otel/sdk to v1.41.0 (#3589) feat: add TiDB module (#3575) feat: add Forgejo module (#3556) feat: improve container conflict detection (#3574) chore(deps): bump go to 1.25 everywhere (#3572) chore(pulsar): bump base image to 4.x, replacing the wait for log strategy with wait for listening port (deterministic) (#3573) chore(deps): bump github.com/sigstore/sigstore in /modules/compose (#3571) chore(compose): update to compose-v5 (#3568) chore(deps): bump github.com/modelcontextprotocol/go-sdk (#3557) chore(deps): bump mkdocs-codeinclude-plugin from 0.2.1 to 0.3.1 (#3561) chore: update usage metrics (2026-03-02) (#3565) chore(deps): bump mkdocs-include-markdown-plugin from 7.2.0 to 7.2.1 (#3562) ...
What does this PR do?
2.10.2to4.0.9across source, tests, examples, and docswait.ForLogstrategy withwait.ForListeningPortfor a more deterministic readiness checkWhy is it important?
Pulsar 2.10.2 bundles an older JDK that crashes with a
NullPointerExceptionon cgroups v2 hosts (including modern GitHub Actions runners), preventing the container from starting. Upgrading to 4.0.9 resolves this incompatibility.The log-based wait strategy was also fragile since the log message could change between versions. Waiting for the listening port is more reliable.
Related issues