Skip to content

Stop skipping "test exception" test cases, they are not synthetic#11427

Open
bric3 wants to merge 1 commit into
masterfrom
bdu/revert-test-exception-synthetic-skip
Open

Stop skipping "test exception" test cases, they are not synthetic#11427
bric3 wants to merge 1 commit into
masterfrom
bdu/revert-test-exception-synthetic-skip

Conversation

@bric3
Copy link
Copy Markdown
Contributor

@bric3 bric3 commented May 20, 2026

What Does This Do

Removes "test exception" from being skipped skipped in the JUnit collect result script. It was added in #11259.
They are legitimate synthetic names (initializationError, executionError), because they are actually coming from framework or libraries. "test exception" is not.

Also, the changes documents the criteria for any future entry, i.e. this should be motivated by a proof with a source link where that synthetic test name is added.

Motivation

Tagging "test exception" name unconditionally will silently skip real tests named that way.

In fact "test exception" isn't a synthetic placeholder emitted by any test framework or runner used with this project:

  • JUnit 4 emits "initializationError" from ErrorReportingRunner (r4.13.2 line 83) when a test class cannot be loaded, has no runnable methods, or its @BeforeClass fails.

  • Gradle's JUnit Platform listener emits both "initializationError" and "executionError" from JUnitPlatformTestExecutionListener (v8.14.5) (also in later version of Gradle) for synthetic failures.

  • JUnit 5, Spock, Kotest, TestNG, Maven Surefire/Failsafe — none use the literal "test exception" as a synthetic.

A code search across junit-team/junit4, junit-team/junit5,
gradle/gradle, spockframework/spock, and jetbrains/kotlin confirms this:
the only Gradle hits are unrelated Javadoc on TestExceptionFormat plus
user-named retry tests.

The test exception entries observed for this repo came from the actual Spock test, HttpServerTest.test exception"().

In addition to dropping this case, this PR documents in a code comment that
future synthetic entries must:

  1. be names that the framework/runner itself produces (never user-authorable);
  2. cite the emitting source file preferring a link with a release tag (rather than a commit hash);
  3. consider the full set of frameworks/libraries in the build (JUnit 4, JUnit Platform engines, Gradle adapters, TestNG, Spock, Kotest, Surefire/Failsafe).

Additional Notes

@bric3 bric3 changed the title Stop tagging "test exception" testcases as synthetic skip Stop tagging "test exception" testc ases as synthetic skip May 20, 2026
@bric3 bric3 added type: bug Bug report and fix tag: no release notes Changes to exclude from release notes comp: tooling Build & Tooling labels May 20, 2026
@bric3 bric3 changed the title Stop tagging "test exception" testc ases as synthetic skip Stop tagging "test exception" test cases as synthetic skip May 20, 2026
@bric3 bric3 changed the title Stop tagging "test exception" test cases as synthetic skip Stop skipping "test exception" test cases, they are not synthetic May 20, 2026
@datadog-datadog-prod-us1
Copy link
Copy Markdown
Contributor

datadog-datadog-prod-us1 Bot commented May 20, 2026

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 7 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-java | Ubuntu_20_amd64.SI94: [test-app-java-alpine]   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). 1 failed test. AssertionError: _container_tags_validator failed to validate trace_id: 21905767702550769 in test_origin_detection.

DataDog/apm-reliability/dd-trace-java | Ubuntu_20_amd64.SI94: [test-app-java-container]   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). 1 failed test: AssertionError: _container_tags_validator failed to validate trace_id: 38619814460857659 in tests/auto_inject/test_auto_inject_install.py:255

DataDog/apm-reliability/dd-trace-java | Ubuntu_23_10_arm64.SI94: [test-app-java-alpine]   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). AssertionError: _container_tags_validator failed to validate trace_id: 28506239448343966 in tests/auto_inject/utils.py:79

View all 7 failed jobs.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f60311a | Docs | Datadog PR Page | Give us feedback!

@bric3 bric3 force-pushed the bdu/revert-test-exception-synthetic-skip branch from 6e334c2 to 8a557eb Compare May 20, 2026 10:40
"test exception" is not a synthetic placeholder emitted by any test
framework — JUnit 4, JUnit Platform, Gradle's adapters, Spock and Kotest
all reserve "initializationError"/"executionError" for that purpose, not
generic English names. In dd-trace-java the entries observed in CI came
from a real Spock feature method (`def "test exception"()` in
HttpServerTest.groovy), not a framework synthetic. Tagging that name
unconditionally silently masks real pass/fail outcomes for any
Spock/JUnit 5 @DisplayName/Kotest test that happens to use it.

Drop "test exception" from JUnitReport.tagSyntheticFailures and document
the criteria for future synthetic entries (must be framework-emitted,
must link to the source pinned to a release tag). Annotate the two
remaining entries — initializationError (JUnit 4 + Gradle) and
executionError (Gradle) — with the canonical source locations.
@bric3 bric3 force-pushed the bdu/revert-test-exception-synthetic-skip branch from 8a557eb to f60311a Compare May 20, 2026 10:59
@bric3 bric3 marked this pull request as ready for review May 20, 2026 11:16
@bric3 bric3 requested a review from a team as a code owner May 20, 2026 11:16
@bric3 bric3 requested review from PerfectSlayer and removed request for a team May 20, 2026 11:16
@bric3 bric3 mentioned this pull request May 20, 2026
1 task
Copy link
Copy Markdown
Contributor

@mhdatie mhdatie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Was there an example in CI where "test exception" should have not been skipped? And thanks for adding the guardrails as comments too, I have another related ticket which can leverage them 👍 🚀

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

Labels

comp: tooling Build & Tooling tag: no release notes Changes to exclude from release notes type: bug Bug report and fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants