fix(scheduler): stop nextest runs inside mbx reserve from waiting on their own lease #1040
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 582 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.381
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1040"
general
weight: 0.35
jdx
With
scheduler.tests = true, acargo nextest runstarted insidembx reserve(or by a wrapper that exportsMBX_SCHED_DISABLE) asked the machine-wide pool for the run's cores a second time, even though the enclosing reservation already pays for them. The compilers in the same run correctly take nothing. When the second request couldn't fit beside the enclosing lease, the run waited at listing forever for capacity its own reservation held:That happened whenever the enclosing reservation held the whole budget, and also for a 1-core reservation with nextest's default thread count, which asks for the whole pool. When the request did fit, the run held two leases for the same work. This was a regression in 1.31.0, which added the run-wide nextest reservation.
Now a nextest run inside an enclosing reservation takes no reservation of its own, as on 1.30.0. Its tests start right away and are charged to the enclosing lease. mbx still runs them through its target runner, so configured runners still chain and each test still gets
MBX_SCHEDULER=0. As before 1.31.0, nextest picks its own width (pass--test-threads "$MBX_RESERVED_CPUS"to keep it inside the lease), and these runs don't record test history. Runs that aren't inside a reservation are unchanged.A run without a reservation now also exports an empty
MBX_NEXTEST_RUN, so a nested run can't inherit an outer run's reservation directory and post its listings there.docs/scheduling.mddescribes the behavior.Validation: a new end-to-end test,
a_nextest_run_inside_an_enclosing_reservation_takes_no_lease_of_its_own, uses a two-core budget and covers three cases: a 1-corembx reservewith one test thread, a 2-corembx reservewith default threads, and a separatembx reserveholding both cores while the run only getsMBX_SCHED_DISABLE=1. In each case the test must start within 20 s, seeMBX_SCHEDULER=0, run while exactly one lease is held, and print no capacity note. Without the fix the first case fails withleft: 2, right: 1.mise run cipasses locally on Linux.Fixes #1038
AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: 2.1.332.
🤖 Generated with Claude Code
<!-- CURSOR_SUMMARY -->
---
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Test runs started within an existing reservation no longer request a separate scheduler reservation, avoiding unnecessary waits.
Runs handle inherited reservation settings consistently when no reservation is active.
Documentation
Updated the scheduling guide with details on running tests within an existing reservation, including guidance on matching test concurrency to reserved capacity.
Clarified that these runs do not record test history.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->