Skip to content

Run the Gradle agent suites in their own e2e leg - #1697

Merged
Mikola Lysenko (mikolalysenko) merged 2 commits into
mainfrom
ci-perf/gradle-agent-leg
Oct 23, 2026
Merged

Mikola Lysenko (mikolalysenko) merged 2 commits into
mainfrom
ci-perf/gradle-agent-leg

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

No ci-perf issue is eligible (the three open ones are settings changes for a human: #1248, #1512, #1670), so this takes the next measurable item from the dashboard. Its 10-23 16:16 run noted that coverage and the Gradle e2e leg "now finish within ~0.3 min of each other" after #1682.

Problem

The PR-tier Gradle leg (e2e (ubuntu-latest, e2e_gradle_discovery_build e2e_gradle_agent_build e2e_redirect_gradle_build, ...)) runs three test binaries one after another on a 4-core host. Timings from the slow run 39998858554 (merge_group):

suite in the leg tests time
e2e_gradle_discovery_build 1 12 s
e2e_gradle_agent_build 11 126 s
e2e_redirect_gradle_build (gradle_hosted_[345]) 10 236 s
leg's Run e2e tests step 374 s (257–264 s on fast hosts)

In the last 10 full runs (6 merge_group, 4 PR), that leg finished after coverage in 4 of them, so it set ci-ok:

run event coverage end Gradle leg end ci-ok held up by
39998858554 merge_group 6.6 9.8 3.2 min
39998197443 merge_group 6.4 6.7 0.3
39973751255 PR 6.0 6.8 0.8
39999474647 PR 6.0 6.1 0.1
39973105417, 39972602293, 39972553515, 39971594300, 39992428403, 39972606456 mg / PR 6.1–9.7 5.6–7.6 0

(Minutes from the run's first job created.)

Change

On every Gradle line (PR tier 9.8.0; extended tier 6.9.4 / 7.6.6 / 8.14.3), split the leg into:

  • e2e_gradle_discovery_build e2e_gradle_agent_build with --ignored gradle_agent_
  • e2e_redirect_gradle_build with --ignored gradle_hosted_3 gradle_hosted_4 gradle_hosted_5

Each new leg selects exactly the tests the old leg did: the discovery and agent suites hold no gradle_hosted_ tests, and the hosted suite holds no gradle_agent_ ones (the prefix guard in ci-e2e-bundle.py enforces that). test_ci_e2e_tiers.py now expects 21 Gradle rows instead of 17. Its Maven-seeding check keys on the vendor suites instead of on "no gradle_hosted_ word in the filter", because that rule would wrongly flag the new agent-only leg. HostedShards still proves that every hosted test runs in exactly one leg per line.

Expected saving

  • The longest Gradle leg drops from 4.3–6.2 min to about 2.6–3.9 min (the hosted_[345] part). That puts it about 2 min under coverage, so coverage is the only thing on the critical path.
  • Critical path: about 0.45 min per run averaged over the 10-run sample (4.4 min in total), and up to ~3 min on a slow host. That is about 20 critical-path min/day across roughly 45 merge_group and PR runs.
  • Cost: one more 4-core leg per PR or merge_group run (about 0.3 job-min of setup), plus 3 legs in the nightly. That is about +15 Linux job-min/day, against roughly 5.6k/day in total.

Measured result

This PR's full run is 40005592193, on 08c3153. The head d791953 differs from it only in comments, docs and a test-tuple rename. Its own run was a stub, because the push landed while the PR was still a draft. All 30 jobs passed.

baseline 39999474647 (PR) this PR
Gradle legs (job duration) one leg: 4.5 min (Run e2e tests 257–374 s across the 3 sampled runs) agent 2.7 min (95 s of tests) + hosted_[345] 3.7 min (157 s)
Last Gradle leg ends 6.1 (coverage 6.0) 5.2 (coverage 6.3)
ci-ok set by the Gradle leg coverage
Gradle job-min 4.5 6.4
Run job-min (Linux) 36.1 53.7

The run-level job-min jump is not this change. Every leg in this run was 0.7–0.9 min longer than in the baseline (for example nuget 0.5 → 1.4, uv 0.4 → 1.2, yarn-classic 1.6 → 2.4). That points to a host start-up gap that hit the whole run. The Gradle cost on its own is +1.9 job-min, and part of that is the same gap. On a normal host it should be about +0.5. Even on this slow-start run, the last Gradle leg ended 1.1 min before coverage. merge_group runs only show the effect after merge, and the profiler will check it.

No macOS or Windows minutes change (all Gradle rows here are ubuntu).

Review notes (/code-review high)

Fixed in d791953: stale "agent + hosted" leg descriptions in ci.yml and docs/testing/README.md, the unclear "past coverage" rationale, and the AGENT_HOSTED tuple name.

Not fixed:

  • The header of gradle-compatibility.yml still says "{agent + hosted, vendor + multi-project}". Editing that file sets off its path-filtered Windows/macOS grid on this PR, which is a lot of runner time for a comment. It can ride the next PR that touches that file.
  • test_maven_seeding_follows_the_filter compares its own needs_maven against the rows, not against ci.yml's case statement. The old assertion did the same. This PR only replaces the "no hosted word" proxy, which the agent-only leg would break, and leaves the test's design alone.
  • Extra setup per leg: about +0.5 job-min per PR or merge_group run and +1.5 per nightly, as estimated above, in exchange for taking Gradle off the critical path. Rebalancing the hosted words instead would not help, because the agent suites alone are 95–138 s and would still be serial with the hosted work.

Where each moved test still runs

Nothing moves tier. All 22 tests of the old 9.8.0 leg still run on every PR and merge_group run, now in two legs. The 6.9.4 / 7.6.6 / 8.14.3 rows stay in e2e-extended (CI_SCOPE=full, nightly, dispatch).

Risk

Low. This is a matrix-row change. The run step's "ran no test" guard still applies to each suite in each leg. ci-ok and clippy are unchanged, and ci-ok already depends on the e2e job as a whole.


Generated by Claude Code


Note

Low Risk
CI matrix and test expectations only; the same tests still run, just sharded across an extra parallel job per Gradle line.

Overview
Splits PR-tier Gradle e2e jobs so discovery/agent suites no longer run in the same leg as the first hosted shard (gradle_hosted_3/4/5). Each Gradle line in ci.yml (e2e for 9.8.0, e2e-extended for 6.9.4–8.14.3) now has a dedicated agent row (e2e_gradle_discovery_build + e2e_gradle_agent_build, filter --ignored gradle_agent_) and a separate hosted shard 1 row (e2e_redirect_gradle_build with the gradle_hosted_[345] filter). Hosted shards 2 and the catch-all leg are unchanged.

Comments in ci.yml document that the old combined leg often outlasted coverage and blocked ci-ok. docs/testing/README.md reflects agent vs hosted (three shards) in the PR matrix table.

test_ci_e2e_tiers.py renames the expected tuple set to AGENT_AND_HOSTED_SHARDS, expects 21 Gradle rows (was 17), and fixes test_maven_seeding_follows_the_filter so Maven install is tied to vendor suites in the row, not the absence of gradle_hosted_ in the filter (which would wrongly require Maven on the new agent-only leg).

Reviewed by Cursor Bugbot for commit d791953. Configure here.


Generated by Claude Code

The PR-tier Gradle leg ran the discovery and agent suites (12 s + 126 s)
and then hosted shard 1 (236 s) back to back on one 4-core host. That
leg took 4.3-6.2 min and finished after coverage in 4 of the last 10
merge_group and PR runs, by up to 3.2 min (run 39998858554: ci-ok at
9.8 min, coverage done at 6.6).

Split it into an agent leg and a hosted_[345] leg on every Gradle line.
Each leg selects exactly the tests it did before: the agent suites hold
no gradle_hosted_ tests and the hosted suite holds no gradle_agent_
ones. The tier test now keys the Maven-seeding check on the vendor
suites instead of on "no hosted filter word", which the agent-only leg
would break.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L25ziyhTM91GYbb3nbj1XY
@mikolalysenko Mikola Lysenko (mikolalysenko) added the ci-perf CI / merge-queue performance finding (profiler routine) label Oct 23, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

The PR-tier comment and docs/testing/README.md still described an
agent + hosted leg per line. Say which job the old leg outlasted, and
rename the tier test's tuple to match its rows.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L25ziyhTM91GYbb3nbj1XY
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

1 similar comment
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit d791953. Configure here.

@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 23, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Ready for review at head d791953.

  • CI: 8/8 non-skipped checks green on the current head, ci-ok included (31 path-skipped). This head only rewords comments/docs, so CI ran the short path; the full e2e run on the previous head (run 40005592193) was green.
  • Bugbot: reviewed d791953, no findings; no open review threads.
  • Doesn't touch CHANGELOG.md. Mergeable against main.
  • Worth a look: the new Gradle agent leg in .github/workflows/ci.yml and the matching tier assertions in scripts/tests/test_ci_e2e_tiers.py.

Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Burn-down agent: labeled Ready for review.

  • Head: d7919534bd17823ebcf06c49e5f39f4fe7fcb480
  • CI: all check runs on this head green (no main-wide failures)
  • Mergeable, no conflicts; does not touch CHANGELOG.md
  • Bugbot reviewed this exact head: no findings; no open review threads
  • Reviewer focus: the new Gradle e2e leg in .github/workflows/ci.yml and the matching tier test in scripts/tests/test_ci_e2e_tiers.py.

Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Final review brief

What it does: Splits each Gradle line's "agent + hosted shard 1" e2e leg into two legs: the discovery + agent suites (--ignored gradle_agent_) and the hosted shard gradle_hosted_[345]. That takes the Gradle leg off the ci-ok critical path (coverage sets it again). CI config + tests only; no Rust code changes.

Risk: low. Each new leg selects exactly the tests the old leg did (the discovery/agent suites have no gradle_hosted_ tests and the hosted suite has no gradle_agent_ ones). Cost: one more 4-core leg per PR/merge_group run.

Look here:

Verified: I read the full diff. I ran python3 -m unittest discover -s scripts/tests -p 'test_ci_*.py' on the head: 100 OK, 6 skipped. The head's CI is a stub (the push landed while the PR was a draft): ci-ok ✅ and clippy skipped, because no Rust changed. The full run 40005592193 on 08c3153 passed 30/30, and git diff 08c3153 d791953 touches only comments, docs and a test-tuple rename (no matrix row changes). Cursor Bugbot ✅. No review threads. CHANGELOG.md untouched.

Changes I made: none.

Open questions: none. The stale header comment in gradle-compatibility.yml is deliberately left for a later PR (see the description).

Auto-merge is armed, so approving sends it straight to the merge queue.


Generated by Claude Code

Merged via the queue into main with commit 6f6c6d3 Oct 23, 2026
39 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the ci-perf/gradle-agent-leg branch October 23, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-perf CI / merge-queue performance finding (profiler routine) Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants