Skip to content

Restore junit4 test ordering on gradle 9.3+ - #12098

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
masterfrom
daniel.mohedano/junit4-gradle-93-ordering-fix
Jul 30, 2026
Merged

Restore junit4 test ordering on gradle 9.3+#12098
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
masterfrom
daniel.mohedano/junit4-gradle-93-ordering-fix

Conversation

@daniel-mohedano

@daniel-mohedano daniel-mohedano commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Adds support for the definition-based JUnit4 processor introduced in Gradle 9.3.

The new instrumentation collects ClassTestDefinition instances, orders their test classes using the existing fail-fast class orderer, and then delegates execution to Gradle in that order.

The existing processor instrumentation remains in place for older Gradle versions. The ordering smoke test now covers Gradle 9.3.0 and the latest Gradle release again.

Motivation

Gradle 9.3 replaced JUnitTestClassProcessor and AbstractJUnitTestClassProcessor with JUnitTestDefinitionProcessor and AbstractJUnitTestDefinitinoProcessor. The executor contract also changed from Action<String> to TestDefinitionConsumer<ClassTestDefinition>.

The existing instrumentation no longer matched these intenral APIs. JUnit 4 classes therefore ran in Gradle's default order instead of the order selected by Test Optimization.

Additional Notes

test-environment-trigger: skip

Contributor Checklist

Jira ticket: SDTEST-3285

@daniel-mohedano daniel-mohedano added type: bug fix Bug fix comp: ci visibility Continuous Integration Visibility tag: ai generated Largely based on code generated by an AI or LLM labels Jul 29, 2026
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 69.73% (+11.88%)

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

@dd-octo-sts

dd-octo-sts Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.00 s 13.95 s [-0.5%; +1.1%] (no difference)
startup:insecure-bank:tracing:Agent 12.94 s 13.09 s [-2.0%; -0.3%] (maybe better)
startup:petclinic:appsec:Agent 17.48 s 17.17 s [+0.9%; +2.7%] (maybe worse)
startup:petclinic:iast:Agent 17.39 s 17.52 s [-1.6%; +0.1%] (no difference)
startup:petclinic:profiling:Agent 17.46 s 17.58 s [-2.2%; +0.9%] (no difference)
startup:petclinic:sca:Agent 17.56 s 17.58 s [-1.2%; +0.9%] (no difference)
startup:petclinic:tracing:Agent 16.57 s 16.73 s [-1.9%; -0.0%] (maybe better)

Commit: 61994ad9 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@daniel-mohedano
daniel-mohedano marked this pull request as ready for review July 29, 2026 10:44
@daniel-mohedano
daniel-mohedano requested a review from a team as a code owner July 29, 2026 10:44

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Datadog Autotest: PASS

More details

The new Gradle 9.3 definition-based collector follows the existing fail-fast ordering flow and the smoke matrix now exercises Gradle 9.3 and latest versions. No diff-specific behavioral regression was confirmed; full compilation was blocked by unavailable network access for the wrapper and an unavailable Java 25 toolchain in the sandbox.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit 8aacf2e · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@daniel-mohedano

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 29, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-29 13:14:58 UTC ℹ️ Start processing command /merge


2026-07-29 13:15:04 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-07-29 13:42:54 UTCMergeQueue: The build pipeline contains failing jobs for this merge request

Build pipeline has failing jobs for f2ca4dd:

⚠️ Do NOT retry failed jobs directly (why?).

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.
Details

Since those jobs are not marked as being allowed to fail, the pipeline will most likely fail.
Therefore, and to allow other builds to be processed, this merge request has been rejected and the pipeline got canceled.

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

View session in Datadog

Bits Code status: ✅ Done

Comment @DataDog to request changes

@daniel-mohedano

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 30, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-30 09:18:33 UTC ℹ️ Start processing command /merge


2026-07-30 09:18:38 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-07-30 10:15:21 UTCMergeQueue: The build pipeline contains failing jobs for this merge request

Build pipeline has failing jobs for 6c6abc7:

⚠️ Do NOT retry failed jobs directly (why?).

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.
Details

Since those jobs are not marked as being allowed to fail, the pipeline will most likely fail.
Therefore, and to allow other builds to be processed, this merge request has been rejected and the pipeline got canceled.

@daniel-mohedano

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 30, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-30 10:17:36 UTC ℹ️ Start processing command /merge


2026-07-30 10:17:41 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-07-30 11:05:39 UTCMergeQueue: The build pipeline contains failing jobs for this merge request

Build pipeline has failing jobs for 32f3715:

⚠️ Do NOT retry failed jobs directly (why?).

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.
Details

Since those jobs are not marked as being allowed to fail, the pipeline will most likely fail.
Therefore, and to allow other builds to be processed, this merge request has been rejected and the pipeline got canceled.

@daniel-mohedano

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 30, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-30 11:06:30 UTC ℹ️ Start processing command /merge


2026-07-30 11:06:35 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-07-30 11:57:59 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit e3dfbac into master Jul 30, 2026
586 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the daniel.mohedano/junit4-gradle-93-ordering-fix branch July 30, 2026 11:57
@github-actions github-actions Bot added this to the 1.65.0 milestone Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: ci visibility Continuous Integration Visibility tag: ai generated Largely based on code generated by an AI or LLM type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants