Skip to content

Fixes #3264 : tests inside @Suite incorrectly classified as flakes#3342

Open
mirkoalicastro wants to merge 1 commit intoapache:masterfrom
mirkoalicastro:fix/suite-flake-misclassification
Open

Fixes #3264 : tests inside @Suite incorrectly classified as flakes#3342
mirkoalicastro wants to merge 1 commit intoapache:masterfrom
mirkoalicastro:fix/suite-flake-misclassification

Conversation

@mirkoalicastro
Copy link
Copy Markdown

@mirkoalicastro mirkoalicastro commented Apr 8, 2026

When rerunFailingTestsCount is used with JUnit Platform @Suite, tests from different classes that share a method name are merged under the Suite class name. It causes real failures to be misclassified as flakes. With the changes in the PR, findTopParent() now stops at engine boundaries (parents with no ClassSource), correctly attributing tests to their actual class while preserving @Nested.

  • New unit test added
  • Verified with the small project shared in the original issue: build correctly fails after fix

Following this checklist to help us incorporate your contribution quickly and easily:

  • Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its clean install).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@mirkoalicastro mirkoalicastro marked this pull request as ready for review April 8, 2026 19:14
@mirkoalicastro mirkoalicastro marked this pull request as draft April 8, 2026 19:19
@mirkoalicastro mirkoalicastro force-pushed the fix/suite-flake-misclassification branch from fabffc2 to 878db1d Compare April 9, 2026 08:53
@mirkoalicastro mirkoalicastro marked this pull request as ready for review April 9, 2026 08:53
@mirkoalicastro
Copy link
Copy Markdown
Author

Hi @olamy , any chance you could have a look at this? 🙏

@mirkoalicastro
Copy link
Copy Markdown
Author

@olamy it looks that there are some failures - unrelated to the changes. Would it be fine to proceed?

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.

1 participant