Retain method failures for shared container lifecycle callbacks - #12083
dlwhdgus0810 wants to merge 1 commit into
Conversation
Preserve method and nested-context failures until shared containers receive their final lifecycle callback. Keep class-level failures and instance callbacks unchanged. Fixes testcontainers#10270
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughChangesShared container failure handling
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant JUnit Jupiter
participant TestcontainersExtension
participant Shared Container
JUnit Jupiter->>TestcontainersExtension: run test lifecycle callback
TestcontainersExtension->>TestcontainersExtension: capture first execution failure
TestcontainersExtension->>Shared Container: signal after-test with failure
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The shared-container failure reporting change is covered across failing, nested, class-lifecycle, and successful paths, with no identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 2 files. (1 skipped: 1 unsupported.)
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 |
Shared JUnit Jupiter containers receive their final lifecycle callback from the class context, which does not contain exceptions from individual test methods. As a result, a static BrowserWebDriverContainer configured with RECORD_FAILING discards its recording even when a test fails.
Retain the first failure per class context and report it when shared containers finish. Nested failures also reach enclosing shared containers without leaking into sibling contexts. Class-level exceptions keep precedence, and shared callback counts and instance-container behavior remain unchanged.
Validation: the initial JUnit-launcher regression failed on upstream for both direct and nested method failures. The final focused suite reports 15 tests, zero failures, and one intentional existing assumption-based skip. Spotless, main/test Checkstyle, and Javadoc pass. No Docker-backed Selenium recording test or full repository suite was run.
Fixes #10270
Summary by CodeRabbit
Bug Fixes
Tests