fix(ci): refresh runner capacity after nightly admission waits

Merged
TE
4d ago
+220-13

Portable placement, nightly control admission and the dedicated nightly build wait can reuse a workflow's fixed runner document after sleeping. A busy-to-idle transition is then invisible until overflow or timeout.

Keep the shared document for the first look and request live runner capacity after each existing wait. Injected test readers keep their existing call contract. This extends the first-look policy in #31889 and depends on its shared client option; this PR is stacked on that branch.

Performance

metricbeforeafterdeltaharness or run link
routing-App runner-list requests/h at 1000 idle first looks/h with fresh state000same document-backed picker entrypoint fixtures
routing-App requests/h at 1000 busy control waits/h, capacity idle on first recheck03000+3000, intentional live rechecktest_busy_document_is_rechecked_live_after_waiting, one visible group and one-page lists
portable/control placement when capacity becomes idle at first recheckoverflow after 180 sfleet at 30 srestores fleet placementbusy-document/live-idle entrypoint regressions
dedicated build placement when capacity becomes idle at first recheckno dedicated placement after 60 sdedicated placement at 30 srestores dedicated placementbusy-document/live-idle build regression

The live recheck trades requests for correctness only after capacity was unavailable. No new timer or wait is introduced; existing waits retain their deadlines and cleanup. This table models the named fixture rate, not total installation traffic. No compilation or cache behavior changes.

Observed / Not run

All 38 portable placement, 11 nightly control and 59 nightly build tests pass. The three new busy-document regressions fail at test-only commit 8ec0eddacfff and pass with the fix. git diff --check passes. No application build is needed for these picker reads.

Changelog

none

Agent session: agent session


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes nightly admission waits reusing a workflow's fixed runner document after sleeping, so a busy-to-idle transition no longer stays invisible until overflow or timeout.

Portable placement, nightly control, and the dedicated nightly build picker now keep the shared document only for their first look, then request live runner capacity on each recheck. Runners that become idle during the existing wait window are now found at the first recheck instead of after overflow or timeout, and no new timers or waits are introduced. Injected test readers keep their existing call contract.