Skip to content

Pass cause exception and fix error message in compose wait tests - #12149

Open
siddiqueirshad wants to merge 1 commit into
testcontainers:mainfrom
siddiqueirshad:fix-testcontainers-issues
Open

siddiqueirshad wants to merge 1 commit into
testcontainers:mainfrom
siddiqueirshad:fix-testcontainers-issues

Conversation

@siddiqueirshad

@siddiqueirshad siddiqueirshad commented Nov 2, 2026 •

Copy link
Copy Markdown

Pass caught \RuntimeException\ as cause parameter to \Assertions.fail\ in \ComposeWaitStrategyTest\ and \DockerComposeWaitStrategyTest\ to preserve root cause stack traces, and correct duplicate 'with failed with' in failure message.

Summary by CodeRabbit

  • Tests
    • Updated failure messages in wait-strategy tests to identify the relevant strategy or strategies, making test failures easier to interpret.
    • Simplified failure messages in Docker Compose wait-strategy tests to state that startup was expected to succeed, without including exception text.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5c493b55-2fc2-482d-b4c4-8824ee572f68
Commits

Reviewing files that changed from the base of the PR and between f74d167 and 3a042c3.

Files selected for processing: 2
  • core/src/test/java/org/testcontainers/junit/ComposeWaitStrategyTest.java
  • core/src/test/java/org/testcontainers/junit/DockerComposeWaitStrategyTest.java

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

The Compose and Docker Compose wait-strategy tests now use failure messages that identify the relevant wait strategy or strategies. The Docker Compose messages no longer append caught exception text.

Changes: Wait-strategy test messages

Layer / File(s) Summary
Clarify wait-strategy failure messages
core/src/test/java/org/testcontainers/junit/ComposeWaitStrategyTest.java, core/src/test/java/org/testcontainers/junit/DockerComposeWaitStrategyTest.java
Updated failure messages for listening-port and multiple-strategy tests. The Docker Compose messages no longer include caught exception text.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: eddumelendez

Merge Risk: Minimal · up to 3a042

The changes improve wait-strategy test diagnostics without introducing production behavior risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the two changes in the PR: passing the caught exception as the cause to Assertions.fail, and fixing the error message in the compose wait tests. It is specific and matches the changese…
Description check Passed The description states the main change: passing the caught RuntimeException as the cause to Assertions.fail in ComposeWaitStrategyTest and DockerComposeWaitStrategyTest, and fixing the duplicated 'wit…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the two changes in the PR: passing the caught exception as the cause to Assertions.fail, and fixing the error message in the compose wait tests. It is specific and matches the changeset. The title does not name the duplicated 'with failed with' wording, but it covers the primary change.

Full details: Description check

Explanation

The description states the main change: passing the caught RuntimeException as the cause to Assertions.fail in ComposeWaitStrategyTest and DockerComposeWaitStrategyTest, and fixing the duplicated 'with failed with' text. It explains the purpose (preserving root cause stack traces). It does not use the template's sections, such as the contributing checklist or issue reference. The template's required parts are mostly guidance, and the description covers the 'describe the change and context' requirement, so the check passes.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant