Repository navigation
Conversation
Contributor
This branch has not been deployed
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.
Fixes the
lib/hosts/daemon-update-safety.test.mjsflake that fails macOS Verify on #569 (runs 45152468094 and 45179660435): three tests time out at Bun's exact 30s limit when the file runs whole, but pass in ~0.3s in isolation.Root cause
Two linked test defects, both in this file — no production code changed:
updatableInstallcreates the fake npm install withmkdirSync, so its mode follows the ambient umask. With a permissive umask (e.g.0007, as in this VM's shell), the install directory ends up group-writable (0770), and the host'sinstallSupportcheck (lib/hosts/updates.ts) correctly refuses a group- or world-writable install directory.planHostUpdatethen returns early with only theunsupported_installblocker, so the update check'sblockedReasonis the install reason and the session reason never surfaces.blockedReasonassertion throws beforegate.resolve()runs, so the monkey-patchedlocalHost.spawnRpc(which awaits the gate forever) is never restored:start()'st.after(daemon.stop()) was registered first and hangs on the pending gated spawn, so the restore hook registered after it never executes. Every later test that spawns a session then hits the dead gate — itsopenis never answered, the 5suntilthrows, and the hungstop()turns the failure into a 30s Bun timeout. The three victims are "a malformed update status…", "a forced update accepts new sessions while it stages…", and "a forced commit defers automatic recovery…".Proven locally: with umask
022the file passes 13/13 in ~1.4s; with umask0007it failed 6 pass / 7 fail in 96s before this fix, with the instrumented run showing theheldanswer carrying the installblockedReasonand the gated spawn waiting on a gate that was never resolved.Fix (test file only)
updatableInstallnow pins the fixture install directory to0o755withchmodSync, so the update check is not decided by whatever umask the runner happens to use.localHost.spawnRpcin atry/finally, so a failed assertion can no longer leave the gate shut or leak the patchedspawnRpcinto later tests.Verification
bun test --timeout 30000 lib/hosts/daemon-update-safety.test.mjs: 13 pass / 0 fail, three consecutive runs under umask0007(~1.3s each; was 6/7 in 96s).lib/hosts/suite: the file is 13 pass / 0 fail inside it. (The suite run has other failures in unrelated files in this VM — pre-existing environment failures; the parent's earlier full-suite baseline on main also failed in this VM. This change touches only this one file.)npx tsc --noEmitandnpx eslint lib/hosts/daemon-update-safety.test.mjs: clean.Unblocks #569.
Summary by CodeRabbit