Skip to content

chore(pulsar): bump base image to 4.x, replacing the wait for log strategy with wait for listening port (deterministic)#3573

Merged
mdelapenya merged 2 commits intotestcontainers:mainfrom
mdelapenya:bump-pulsar
Mar 7, 2026
Merged

chore(pulsar): bump base image to 4.x, replacing the wait for log strategy with wait for listening port (deterministic)#3573
mdelapenya merged 2 commits intotestcontainers:mainfrom
mdelapenya:bump-pulsar

Conversation

@mdelapenya
Copy link
Copy Markdown
Member

@mdelapenya mdelapenya commented Mar 7, 2026

  • chore(deps): bump Pulsar image to 4.x
  • fix(pulsar): change wait strategy, from log to listening port

What does this PR do?

  • Bumps the default Pulsar image from 2.10.2 to 4.0.9 across source, tests, examples, and docs
  • Replaces the wait.ForLog strategy with wait.ForListeningPort for a more deterministic readiness check

Why is it important?

Pulsar 2.10.2 bundles an older JDK that crashes with a NullPointerException on 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

@mdelapenya mdelapenya requested a review from a team as a code owner March 7, 2026 13:41
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 7, 2026

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 47bf7b0
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-go/deploys/69ac2b17a4c9110008032b5c
😎 Deploy Preview https://deploy-preview-3573--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
Copy Markdown

coderabbitai Bot commented Mar 7, 2026

Summary by CodeRabbit

  • Documentation

    • Updated Pulsar documentation and examples to version 4.0.9
  • Tests

    • Updated test configurations to use Pulsar 4.0.9
  • Improvements

    • Updated container readiness detection to use port listening instead of log matching

Walkthrough

The 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

Cohort / File(s) Summary
Image Version Updates
docs/modules/pulsar.md, modules/pulsar/examples_test.go, modules/pulsar/pulsar_test.go
Updated Pulsar container image from version 2.10.2 to 4.0.9 in documentation example, test examples, and test suites.
Waiting Strategy & Runtime Update
modules/pulsar/pulsar.go
Updated container image to 4.0.9 and replaced wait strategy from log message listening to port listening in defaultWaitStrategies.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • #3426: Modifies wait-strategy setup and touching RunContainer/Run in the pulsar module similarly.

Suggested labels

chore

Poem

🐰 A hop to version four-point-oh,
Pulsar's port now sets the flow,
No more logs to chase and scan,
Just listening—that's the plan!
Whiskers twitch, the upgrade's set, ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: bumping Pulsar base image to 4.x and replacing the wait strategy from log to listening port.
Description check ✅ Passed The description provides clear context about what the PR does, why it's important, and references the related issue, all directly aligned with the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
Copy Markdown

@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.

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 | 🟠 Major

Don't replace broker readiness with a socket-open check.

wait.ForListeningPort(defaultPulsarPort) only proves that 6650/tcp is accepting TCP connections. It does not prove the Pulsar broker is ready for client operations, so Run can 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7cb85f8 and 47bf7b0.

📒 Files selected for processing (4)
  • docs/modules/pulsar.md
  • modules/pulsar/examples_test.go
  • modules/pulsar/pulsar.go
  • modules/pulsar/pulsar_test.go

@mdelapenya mdelapenya self-assigned this Mar 7, 2026
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Mar 7, 2026
@mdelapenya mdelapenya merged commit bc5413d into testcontainers:main Mar 7, 2026
19 checks passed
@mdelapenya mdelapenya deleted the bump-pulsar branch March 7, 2026 13:55
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Mar 7, 2026
* 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)
mdelapenya added a commit that referenced this pull request Mar 9, 2026
…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)
  ...
mdelapenya added a commit that referenced this pull request Mar 9, 2026
…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)
mdelapenya added a commit that referenced this pull request Mar 10, 2026
…-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)
  ...
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.

Pulsar module: container fails to start due to cgroups v2 incompatibility

1 participant