Repository navigation
Conversation
The test tasks of one Gradle project run one after another. On JVM 8 and 11, lettuce-5.0 runs about 25 minutes of tests in a row and sets the length of test_inst shard 6, and jdbc does the same for shard 5. Moving whole projects to other slots cannot shorten those chains. Move some of their test tasks to light slots with a small override map keyed by the total slot count. A project with moved tasks joins every slot that runs one of its tasks, and each slot aggregate runs only the test tasks assigned to that slot. Unlisted tasks keep the hash slot. Muzzle checks stay in each project's own hash slot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After the first split, akka-http-10.0 became the longest chain of test tasks in a row (about 33 minutes on JVM 11, slot 2). Move its version101 tasks to slot 6 and its version102 tasks to slot 7, and move the lettuce62 pair from slot 3 to slot 4, based on the per-slot durations measured in the first treatment run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41dce11d88
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } else { | ||
| // Run only the test tasks of the selected slot, as a project's tasks can be split across slots | ||
| val (selectedSlot, totalSlots) = slot | ||
| dependsOn(testTask.taskDependencies.getDependencies(testTask).filter { testTaskSlot(it.path, totalSlots) == selectedSlot }) |
There was a problem hiding this comment.
Keep coverage dependencies in the project's own slot
When instrumentationTest is run with both -Pslot=x/8 and -PcheckCoverage, split projects are selected in every override slot and this filter schedules only the assigned test tasks, but the subsequently added jacocoTestReport bypasses the filter: gradle/jacoco.gradle makes that report depend on test and forkedTestJacocoData. Because the Test.onlyIf predicate is project-wide, those own-slot tests execute again in each override slot (for example, lettuce's test and forkedTest run in slots 3, 4, and 6), violating the one-shard-per-test invariant and producing redundant coverage runs. Disable task overrides when coverage is requested, or add coverage/report dependencies only in the project's own slot.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This can't happen with the current overrides, so I'm leaving the code as is:
- All overridden tasks belong to
:dd-java-agent:instrumentation:*projects (lettuce-5.0, jdbc, akka-http-10.0), and code coverage is never applied to those:gradle/java_no_deps.gradleexcludes every:dd-java-agent:instrumentationpath before applyinggradle/jacoco.gradle. SofindByName("jacocoTestReport")returns null for split projects and no coverage dependency is added. - Dry run on this branch:
./gradlew :instrumentationTest -Pslot=3/8 -PcheckCoverage -mschedules only the moved lettuce tasks in slot 3. NojacocoTestReport, and lettuce's own-slottestandforkedTestare not scheduled. - In CI,
-PcheckCoverageis only set for:baseTest(4 slots) and:debuggerTest, and the overrides only apply to 8-slot instrumentation jobs.
If coverage is ever enabled for instrumentation projects, the coverage dependencies should follow the muzzle approach (isInOwnSlot). I'd rather not add that guard now, since it would never run.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
There was a problem hiding this comment.
Direct eight-slot test commands execute split-project tests in multiple shards because the execution guard still checks project membership. The new task filtering protects aggregate commands only.
🤖 Bits Code Review · Commit 41dce11
| ) | ||
|
|
||
| projectSlot == selectedSlot | ||
| selectedSlot in projectSlots |
There was a problem hiding this comment.
Direct slotted test commands execute split-project tests repeatedly
For direct commands such as ./gradlew test -Pslot=3/8, the existing Test.onlyIf guard still checks project.isInSelectedSlot. This predicate now enables lettuce-5.0 in slots 3, 4, and 6, so its ordinary test task runs in all three instead of only slot 6. The filtering in createRootTask does not protect direct test, check, or module-level allTests invocations. Apply task-level slot eligibility in the execution guard as well.
React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it
What each reaction means
- 👍 Useful: correct, and you're fixing it or will.
- 👎 Wrong: the finding is incorrect, for example the bug can't happen or the code was misread.
- 😕 Unclear: you can't tell what it means or why it matters.
- 👀 Right, not acting: correct, but intended, out of scope for this PR, a known risk, or too minor.
🤖 Bits Code Review · Open Bits AI session
There was a problem hiding this comment.
Good catch, fixed in faa2034. The Test.onlyIf guard now checks the test task's own slot (new Task.isInSelectedTestSlot: its override slot, or else its project's slot) instead of whether the project runs in the slot. Projects without overrides behave as before.
Checked with real runs, since dry runs don't evaluate onlyIf:
- lettuce-5.0
testwith-Pslot=3/8,lettuce60Testwith-Pslot=6/8andforkedTestwith-Pslot=4/8are skipped (onlyIf 'Test task is in selected slot' is false). lettuce60Testwith-Pslot=3/8andtestwith-Pslot=6/8still execute.:instrumentationTest -Pslot=3/8still schedules the moved lettuce tasks, and the buildSrc tests pass.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
The Test onlyIf guard checked whether the project ran in the selected slot. A split project runs in several slots, so a direct command such as `./gradlew test -Pslot=3/8` ran its own-slot tasks in every one of them. Check the test task's own slot instead, so each test task runs in exactly one slot however it is invoked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Thank for this improvement.
I haven't reviewed it yet, the idea is indeed interesting, but I'm not sure on the maintainability.
A bare glance shows it's much much better than #12822.
I'm just marking a "request changes" preemptively to avoid early merge.
There was a problem hiding this comment.
More details
The PR redistributes long instrumentation test chains across eight CI shards while keeping muzzle checks in each project’s original shard. The new task-level execution guard fixes duplicate test execution for direct slotted commands; no review findings remain open, though runtime validation remains unverified.
🤖 Bits Code Review · Commit faa2034
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
What Does This Do
Shortens full CI pipelines by about 12 minutes by splitting the longest chains of test tasks across
test_instshards. Every test still runs in exactly one shard, and muzzle checks stay in each project's own shard.Motivation
Shards are assigned by
path.hashCode() % slots, which balances the number of projects, not their duration. A project's test tasks run one after another, so a few projects set the length of the whole pipeline: since #13218, lettuce-5.0 runs about 25 minutes of tests in a row, followed by akka-http-10.0 and jdbc. On JVM 8 and 11 the slowest shard took 45–51 minutes while most took 20–30.This change moves selected test tasks of lettuce-5.0, jdbc and akka-http-10.0 to light shards through a small override map keyed by slot count (8 only). Projects stay intact; each shard only selects which of their test tasks it runs. Unlisted tasks keep the hash slot, and
test_inst_latest(/6),check(/4) andtest_base(/4) are unchanged.Additional Notes
Improvements
Each step was measured on DDCI against a control pipeline started at the same time (same base, a no-op
buildSrcchange so both run the full suite), one run per arm:test_instshard, JVM 11 / 8test_inst_latest)The pipeline is now limited by
test_inst_latest [8, 3/6](about 37 min plus its build), which this PR does not change. Against the full-execution baseline (p50 54.5 min over 28 pipelines), the expected p50 is about 42–44 min; that needs data after merge to confirm.Tests
CIJobsExtensionsTest(new, JUnit 5):instrumentationTestslot:runMuzzleslotcheck(/4) andlatestDep(/6) dry runsAdvantages
Drawbacks
test_instjobs benefit. Going further needs the same fortest_inst_latest.Jira ticket: SDCT-1444
🤖 Generated with Claude Code