Skip to content

fix(test): /proc is not a portable unwritable-path fixture — on Linux it hangs CI#26

Merged
jellologic merged 1 commit into
mainfrom
fix/linux-test-hang
Jul 22, 2026
Merged

fix(test): /proc is not a portable unwritable-path fixture — on Linux it hangs CI#26
jellologic merged 1 commit into
mainfrom
fix/linux-test-hang

Conversation

@jellologic

Copy link
Copy Markdown
Owner

Two test files used /proc/nonexistent/... to stand for "a directory that cannot be written". On macOS there is no /proc, so mkdirSync(recursive) failed fast with ENOENT and the tests passed. On Linux the same call hangs — not throws, hangs, with no output, no exit and no timeout.

That wedged the Test step of every Linux CI job on #25 for 18 minutes while both macOS jobs finished in ~40 seconds, and it was only visible once the branch met a Linux runner for the first time.

This blocks releasing. publish.yml runs on ubuntu-latest and gates on npm test, so tagging main in this state would hang the publish job rather than publish anything.

The fix uses the pattern test/adapters/fs-cursor-store.test.ts already established and I should have followed: a real temp directory chmod'd to 0500, restored in a finally. Portable, and it exercises a genuine permission denial rather than a filesystem curiosity.

Reproduced and verified in a node:22-slim container as a non-root user: 740/740 on Linux, matching macOS. The resulting tree is byte-identical to the head of #25, which passed all four CI jobs green.

For whoever writes the next store test: an "obviously bad path" fixture has to be bad in the same way on every platform the suite runs on, or it is testing the platform rather than the code.

Both new stores used `/proc/nonexistent/...` to stand for a directory that
cannot be written. On macOS there is no /proc, so `mkdirSync(recursive)` failed
fast with ENOENT and the tests passed. On Linux the same call **hangs** — not
throws, hangs, with no output, no exit and no timeout — which wedged the Test
step of every Linux CI job while both macOS jobs finished in about 40 seconds.

This branch had never met a Linux runner until the PR, so it was the first
opportunity to find it. Reproduced in a node:22-slim container, bisected to the
exact call, and fixed by using the pattern fs-cursor-store.test.ts already
established and I should have followed: a real temp directory chmod'd to 0500,
restored in a `finally`. Portable, and it exercises a genuine permission denial
rather than a filesystem curiosity.

Full suite now 740/740 on Linux as a non-root user, matching macOS.

Worth stating for whoever writes the next store test: an "obviously bad path"
fixture has to be bad in the same way on every platform the suite runs on, or it
is testing the platform rather than the code.

Signed-off-by: jellologic <31935831+jellologic@users.noreply.github.com>
@jellologic
jellologic merged commit 0b16548 into main Jul 22, 2026
4 checks passed
@jellologic
jellologic deleted the fix/linux-test-hang branch July 22, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant