Cause: the fake devin CLI is a shell script written when the file loads,
and macOS checks a new executable the first time it runs (com.apple.
provenance; ~0.3s on an idle machine, measured, the second run 0.01s).
The first test that runs the CLI ("when Devin can't tell, ...") paid that
check inside its 30s bound, and on a loaded machine the check took longer.
Its CLI then outlived it and wrote "auth status" into the one shared
cli.log, which the next tests read as their own call list.
Now beforeAll runs the fake once and waits for it to exit (the state, not
a duration; a 10-minute hook bound only so a broken exec can't hang the
run), so no test's time holds the check. Each test's runs go to a log of
its own (FAKE_LOG), so a run a test left behind can't land in the next
test's list.
Run on macOS arm64, bun 1.4.2:
- Injected: the fake slept 35s on its first run only (a slow first-run
check). origin/main's test: red, "when Devin can't tell" timed out after
30000ms, as in the issue. With this change: 11 pass, 0 fail (35.6s).
- Loaded: 6 parallel loops of 10 fresh `bun test
packages/devin/identity.test.mjs` (each a new script, so each pays the
check) at load average ~55: 0 of 60 runs failed; earlier 8 x 15: 0 of 120.
(--rerun-each doesn't apply: the plugin's per-key caches outlive a rerun,
red on origin/main too.)
- `HOME=$(mktemp -d) bun test` from the root: 1920 pass, 0 fail.
`bun scripts/check.mjs`: ok.
Test-only, no version bump.