Repository navigation
fix(test): prevent Chromium crashes under deep temporary roots - #196509
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@clawsweeper review Please review the final candidate at b1e8470384b52f5ae9c3ea0926a9c2985a8b2d4c, particularly inherited resource-owner claims when a long temporary root relocates. The real Linux UI e2e reproduces the fatal Chromium startup abort on the parent and passes after this change. Local dead-export findings in unchanged owners are under exact-parent attribution; they are disclosed in the PR body. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR relocates oversized POSIX test temporary directories to /tmp and clarifies workspace output guidance. Example: Run the Chromium chat-flow tests with TMPDIR beneath a deep worktree.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a concrete test-runner failure without adding another ownership path; the earlier merge conflict is resolved, and no actionable patch defects were found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Vitest process owner receives subprocess specifications and inherited environment variables, allocates temporary storage, launches children, and releases storage after process and resource completion. flowchart TD
A[Vitest CLI] --> B[Process owner]
B --> C[Inherited resource claim]
B --> D[Short temporary namespace]
D --> E[Vitest and Chromium]
E --> F[Process and resource settlement]
F --> G[Cleanup and claim release]
Technical reviewBest possible solution: Keep the byte-budget check in the existing Vitest process owner while preserving inherited claims and shared workspace recovery guidance. Do we have a high-confidence way to reproduce the issue? Main propagates arbitrarily deep inherited roots into child TMPDIR; the supplied Linux reproduction identifies Chromium's overlong singleton socket, but this review executed no target code. Is this the best way to solve the issue? This is the smallest complete shared fix: shorten allocation at the process owner, retain lifecycle ownership, and distinguish reusable outputs from native temporary directories. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d3027457406b. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests +56, Docs +10, Other +9. Total +75 across 9 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 10, 2026, 2:58 AM ET / 07:58 UTC (Revision 2). |
Keep test TMPDIR paths within the Unix socket budget while retaining containing-owner claims and cleanup. Clarify that workspace-local scratch guidance applies to output files, not process temporary directories. Linux UI e2e reproduces the startup abort before the fix and passes afterward.
b1e8470 to
8daf57c
Compare
|
Addressed item 1 — resolve the merge conflict in The output-file wording now lives in the shared The updated body also contains exact-parent reproduction and causal attribution for the unchanged dead-export failure. Every other @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…law#196509) Keep test TMPDIR paths within the Unix socket budget while retaining containing-owner claims and cleanup. Clarify that workspace-local scratch guidance applies to output files, not process temporary directories. Linux UI e2e reproduces the startup abort before the fix and passes afterward.
What Problem This Solves
Fixes Chromium aborting with “Socket path too long” when agents run UI tests with
TMPDIRbeneath a deeply nested worktree.User Impact
UI tests can launch Chromium from deep worktrees. Workspace-only file guidance now distinguishes disposable output files from native tools’ inherited temporary directories. No configuration changes are needed.
Why This Change Was Made
The Vitest process owner now reserves 45 bytes for Unix socket suffixes and the terminating NUL within the portable 104-byte limit. It uses
/tmpwhen the canonical inherited path exceeds that budget, while keeping the inherited owner's claim, process-group settlement, neutral package scope, and cleanup behavior. Windows keeps its existing path handling.Chromium creates its singleton socket under its temporary directory (source); its POSIX temp resolver reads
TMPDIR(source). Playwright supports a launchenvoverride, but the test-process owner fixes the shared boundary for all subprocesses without per-browser workarounds.Evidence
node scripts/run-vitest.mjs ui/src/e2e/chat-flow.messaging.e2e.test.ts --maxWorkers=1aborts before the fix with a 142-byte singleton socket path. Both fixed trials pass 10/10 tests with a 62-byte socket path; no owned temp directories remain.pnpm check:changedcompleted: all checks passed except the dead-export scan (32 production and 10 full-tree entries in unchanged owners). The same signatures reproduce on both exact main parents; source-history attribution is below. This remains a failed gate, not a passing result.Production LOC net 0; tooling +7; tests +56; docs +10. The test-line allocation covers byte-boundary/socket ownership regressions and the prompt-policy assertion. Existing retention fixtures use explicit short roots so they continue testing nested containment; the new regression tests relocation. Changelog remains release-owned.
Inherited main dead-export regression: exact-parent proof and source attribution
node --import tsx scripts/check-deadcode-exports.mtsfails identically on original parentbaccc7e152916c7f4a48596b5cb544c12264ac54and final parentcdd7ee54ee8df226291bb97a1077731f40fbd273: 32 production and 10 full-tree findings, zero signature differences; the script scan passes. The isolated baseline uses the same existing dependency installation. A first baseline attempt with missing workspace module links was discarded as a setup failure; the qualified results use all workspace dependency links.These are real main maintenance regressions. Attribution comes from commit diffs and commit-tree consumer references, not a claimed whole-gate bisect at every introducing commit.
nestRequiredSummaryHeadingsc7152f3bda8emodels-config,auth-storage,model-registry, client-cap and OOM facades625945b7ae0180ba593b8b14replyWithBillingRouteWarnings56617cd00086f63e5cd0f6d3cf1ae7bb6a72BROWSER_PAIR_CODE_LENGTHd85ebfe8daadauthorDisplayName832bbf926fc55ec102bde3fb1a1b5e4341b848b6964fa991c0af071f606eae77resolveProviderRuntimePluginbarrela7436c8b4a93bff59d099661d2b206bb0627ac2bresolveProviderModernModelRefproduction caller moved into test helpers33d8f24c9926isLaunchctlNotLoadedcaller moved to concrete ownerb4262689db5dparseLaunchAgentEnabledexported with only an internal production call7713e8fb749eresolveLaunchAgentPlistPathcaller moved to concrete owner5e5912058286Final-head CI and inherited test-line debt
On head
8daf57c672d28223e92eaa01aa8bff4467d91b84, all selected test, type, lint, documentation and UI e2e shards passed. Codex review is clean; ClawSweeper revision 2 reports zero open items on this exact head. OpenGrep and CodeQL quality/security initially failed when GitHub exhausted its installation API quota during upload. Only failed jobs were retried after newer runs showed recovery; all three workflows passed attempt 2.CI run 42778351212 remains red solely for the test-line ratchet and its aggregate gate. Its tested merge is
22f24153e6478b18affb6b9cfd9cd2aa22925c5f, with ordered parents maind3027457406b7c694ba00dd0f1cd506567f43878and this PR head. The merge has 6,619,045 test lines against a 6,618,752 ceiling: 293 over, with this PR's +56 covered by its separate 56-line allocation.The exact main parent already has 6,618,989 lines against a 6,618,696 ceiling, also 293 over. Native reproduction on that tree against the immutable pre-debt base (
e6afc3c54002^) exits 1. Comparing main to itself or its zero-growth immediate parent exits 0 because the checker tolerates debt when delta is zero; those passing comparisons are not presented as failed reproductions. Source LF counts attribute the debt to #194996 (e6afc3c54002, +71 without allocation), #188748 (441b6139039d, +223 without allocation), and #194429 (baccc7e15291, -1). This is a real inherited main budget regression, separate from the local unused-export failures above. No ceiling or unrelated tests were changed to hide it.