Skip to content

fix(pulsar): increase wait strategy deadlines to fix random test time…#3600

Draft
ljluestc wants to merge 1 commit intotestcontainers:mainfrom
ljluestc:fix/pulsar-test-timeout-2886
Draft

fix(pulsar): increase wait strategy deadlines to fix random test time…#3600
ljluestc wants to merge 1 commit intotestcontainers:mainfrom
ljluestc:fix/pulsar-test-timeout-2886

Conversation

@ljluestc
Copy link
Copy Markdown

The Pulsar module used WithWaitStrategy which has a default 60s deadline. Pulsar is a heavy Java application that can take longer than 60s to start, especially in CI environments, causing random context deadline exceeded failures.

Changes:

  • Use WithWaitStrategyAndDeadline(2min) for default Run()
  • Use WithWaitStrategyAndDeadline(3min) for WithFunctionsWorker()
  • Use WithWaitStrategyAndDeadline(2min) for WithTransactions()
  • Add explicit WithStartupTimeout(2min) to HTTP wait strategies

Fixes #2886

What does this PR do?

Replaces WithWaitStrategy (which uses a hardcoded 60s deadline) with WithWaitStrategyAndDeadline using longer timeouts throughout the Pulsar module:

  • Run(): 2 minute deadline
  • WithFunctionsWorker(): 3 minute deadline (functions worker adds extra startup time)
  • WithTransactions(): 2 minute deadline

Also adds explicit WithStartupTimeout(2*time.Minute) to the HTTP wait strategies for the admin API and transaction topic endpoint checks.

Why is it important?

Pulsar is a heavy Java application whose startup time can exceed 60 seconds, especially in resource-constrained CI environments. The default 60s deadline causes flaky context deadline exceeded failures, making the test suite unreliable. Increasing timeouts to 2-3 minutes gives Pulsar sufficient time to fully initialize.

Related issues

…outs

The Pulsar module used WithWaitStrategy which has a default 60s deadline.
Pulsar is a heavy Java application that can take longer than 60s to start,
especially in CI environments, causing random context deadline exceeded
failures.

Changes:
- Use WithWaitStrategyAndDeadline(2min) for default Run()
- Use WithWaitStrategyAndDeadline(3min) for WithFunctionsWorker()
- Use WithWaitStrategyAndDeadline(2min) for WithTransactions()
- Add explicit WithStartupTimeout(2min) to HTTP wait strategies

Fixes testcontainers#2886

Co-Authored-By: Oz <oz-agent@warp.dev>
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 21, 2026

Deploy Preview for testcontainers-go failed.

Name Link
🔨 Latest commit d642284
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-go/deploys/69bed6c21d8f810008f4960f

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 21, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8647679b-53f9-4d36-8aba-930edc3c6b8c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Tip

You can generate walkthrough in a markdown collapsible section to save space.

Enable the reviews.collapse_walkthrough setting to generate walkthrough in a markdown collapsible section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: random pulsar test failures

1 participant