fix(e2e): stop the shared profiles lock from killing tests - #393
Merged
Conversation
The `E2E tests (Linux, Bun 1.4.x)` job failed the 0.6.0 release run with
`basic/auth-errors` dying 717ms in:
rm: cannot remove '/tmp/mcpc-e2e-.../profiles.lock': Is a directory
Tests sharing a home directory serialise their profiles.json writes on a
mkdir lock directory, and the release side of that lock was broken twice
over:
- It released through a `trap ... RETURN`, which also fires when the
*calling* function returns, so every acquisition released twice — the
second removal deleting a lock another test already held.
- It released with `rm -rf`, which walks the path. Raced against another
test's mkdir of the same lock, GNU rm reports "Is a directory" and
exits 1, and under the framework's `set -e` that aborts the test.
Release exactly once with rmdir instead, record write failures rather
than aborting mid-critical-section (so the lock is never leaked), and
make run.sh's end-of-run cleanup best-effort so a stray bridge cannot
turn a green run red.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019kKuHZzZddAKVu2MB5YoK2
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.
The
E2E tests (Linux, Bun 1.4.x)job failed the 0.6.0 release run (run 34470529171) withbasic/auth-errorsdying onrm: cannot remove '.../profiles.lock': Is a directory, which gated the publish step. The mkdir lock that serialisesprofiles.jsonwrites across tests sharing a home directory was released twice per acquisition — atrap ... RETURNalso fires when the calling function returns — and released withrm -rf, which walks the path and fails with exactly that error when raced against another test'smkdir(reproducible on coreutils 9.4; underset -eit aborts the test). Bun 1.4 only shifted the timing.rmdirinstead of aRETURNtrap andrm -rf._write_test_auth_profile.run.sh's end-of-run cleanup best-effort so a stray bridge can't turn a green run red.Verified with the full suite under Bun (
--parallel 8, shared home): the only failure left isbasic/remote-open, which needs outbound access tomcp.apify.comand fails the same way onmain. Anrmshim confirms zerormcalls against the lock, down from 2–6 per test.🤖 Generated with Claude Code
https://claude.ai/code/session_019kKuHZzZddAKVu2MB5YoK2