Repository navigation
chore: pnpm gates runs one at a time per machine - #2180
Merged
Merged
Conversation
…es stop starving each other into test timeouts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pnpm gates(scripts/ci/gates.sh) takes a machine-wide lock,/tmp/yui-gates-<uid>.lock(a directory holding the holder's pid), so a second run on the same machine prints onewaitline and starts when the first ends. A lock whose pid is no longer alive is taken over. The lock is removed on exit.Why: on 2026-11-30 three task worktrees of #2179 ran
pnpm gatesat once on a 12-core Mac; load average reached 154 (uptime), andpnpm testfailed with 5000 ms timeouts in tests the changes did not touch (32 cases in one run, 9 in a rerun, about 18 in another), each passing when run alone. Waiting costs less than a starved run plus its rerun.The workflow side changes with it (outside the repo, in the shared
.claudeskill): task implementers run only their changed tests, the type check and biome, andpnpm gatesruns once per change on the integration or PR branch.Related issues
Runtime evidence
The lock block run on its own (
bash -cwith the block sourced):999999): taken over at once, released on exit;sleep 7: printedwait another gates run holds the lock (pid …), took the lock 10 s later (one 5 s poll after the holder ended), released on exit.Verification
bash scripts/ci/test-guard.sh origin/mainandbash scripts/ci/rule-tests.sh origin/mainexit 0gates.shChecklist (YUI principles)
CONTRIBUTING.mdsays gates run one at a time per machine