[WRONG BRANCH] fix(test): scope test-run lock to user home to avoid cross-user DO S - #345
[WRONG BRANCH] fix(test): scope test-run lock to user home to avoid cross-user DO S#345luvs01 wants to merge 1 commit into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Its title has been prefixed with |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 431b997c78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| /** Keep the shared lock in a directory controlled by the current OS user. */ | ||
| export function resolveDefaultTestRunLockPath(home = homedir()): string { | ||
| return join(home, ".opencodex-bun-test.lock"); |
There was a problem hiding this comment.
Keep the PID-based lock on a host-local filesystem
When the same home directory is mounted on multiple hosts, as with NFS/SMB enterprise homes or CI containers sharing a home volume, this path makes those hosts operate on one lock even though processIsAlive() checks PIDs only on the local host. A second host can therefore reclaim an active lock because its local PID is absent and run a suite concurrently, or wait 45 minutes because an unrelated local process has the same PID. Use a user-owned host-local directory, or include a stable host identity in the lock namespace, so the lock's filesystem scope matches its PID-liveness scope.
AGENTS.md reference: scripts/AGENTS.md:L14-L15
Useful? React with 👍 / 👎.
Motivation
Description
/tmp-based default lock with a user-local lock path and exposeresolveDefaultTestRunLockPath(home?: string): stringthat returnsjoin(homedir(), ".opencodex-bun-test.lock")and use it as the default lock location inacquireTestRunLock(scripts/test-run-lock.ts).scripts/test.ts,tests/preload.ts).tests/test-runner.test.ts).lockPathto override, and theOCX_TEST_NO_QUEUE=1escape hatch remains supported.Testing
bun test --preload ./tests/preload.ts tests/test-runner.test.ts; the modified runner tests passed overall for the lock-related cases (16 passed, 2 skipped) while one unrelated wrapper assertion failed due to the environment's Bun binary version not emitting the expectedPARALLELmarker (environment mismatch), so the lock regression assertions themselves succeeded.bun run prepush) which completed typecheck and GUI lint steps; the full test suite exercised many environment-sensitive baseline failures unrelated to this change (several long-running/timeouting tests and sandbox-related Lab failures), but the lock-related unit and integration checks included here passed.git diff --checkand local verification of modified files were performed and showed only the intended edits toscripts/test-run-lock.ts,scripts/test.ts,tests/preload.ts, andtests/test-runner.test.ts.Codex Task