Repository navigation
test: fix macOS portability failures in CSO and PTY suites (#2908-#2911) - #2932
Closed
furuchanchan wants to merge 1 commit into
Closed
furuchanchan wants to merge 1 commit into
furuchanchan wants to merge 1 commit into
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
5 tasks done
…2908-garrytan#2911) Running the free suite on macOS surfaced four classes of failures, all test-harness portability issues rather than product bugs: - garrytan#2908: chromium-profile-isolation teardown kills the daemon's whole process group; on macOS a group whose members already exited fails EPERM (not ESRCH), which safeKill rethrows. Tolerate EPERM in this best-effort test teardown only. - garrytan#2909: the case-collision fixture cannot create TRACKED.ts beside tracked.ts on case-insensitive APFS; assert the variant only when the volume actually preserved it. - garrytan#2910: BSD mktemp ignores TMPDIR for bare mktemp; give the redact/PR-body scratch files an explicit TMPDIR-anchored template (placeholder still at end, per garrytan#2091). Regenerated outputs and golden fixtures match. - garrytan#2911: plan-count file-permission tests timed out for two reasons: spawned children report process.cwd() kernel-resolved (/var -> /private/var) while fixtures kept the symlinked spelling, so transcript/hook records never matched; and the default 120-col PTY wrapped long per-user TMPDIR paths mid-string. Resolve the fixture cwd, let runPlanSkillCounting forward cols, and let the recorder's tmpdir containment fall back to canonical paths (identity checks stay exact-string). - pty-screen: importing the bundled xterm headless build via a data: URL exceeds the module-specifier length cap on newer Bun (NameTooLong); spool it to a temp file instead. This was masking the real garrytan#2911 symptoms behind "PTY screen unavailable". Verified on macOS (Bun 1.3.11): cso-git-hardening 10/10, plan-count-file-permission 13/13, chromium-profile-isolation 9/9, spec-quality-gate-secret-sink 12/12, regression-issue2091-bsd-mktemp + gen-skill-docs 444/444. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration
Bot
force-pushed
the
fix/macos-test-portability
branch
from
October 3, 2026 00:07
10f15ed to
a72d830
Compare
Contributor
|
Thanks for this, @furuchanchan. The fix is now on main: the EPERM teardown and TRACKED.ts case-fixture fixes are both on main (fixed in v1.91.16.0, #3014). Closing as superseded; if you still see the problem on the latest gstack, please open an issue with ./setup --status output. |
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.
Summary
Running the free test suite on macOS surfaced four classes of failures in the CSO/PTY test harness — all portability issues in test infrastructure, not product bugs. Fixes for #2908, #2909, #2910, #2911.
browse/test/chromium-profile-isolation.test.ts): teardown kills the daemon's whole process group viasafeKill(-daemonPid, 'SIGKILL'). On macOS a group whose members already exited failsEPERM(notESRCH), whichsafeKillrethrows. The teardown now toleratesEPERM— scoped to this best-effort cleanup only;src/error-handling.tsis unchanged.test/cso-git-hardening.test.ts): on case-insensitive APFS theTRACKED.tsfixture write collapses onto the committedtracked.ts, so the two-file case can never exist. The test now asserts the variant only when the volume actually preserved it. Also canonicalized the fixture root (realpathSync) since macOS's per-userTMPDIRlives behind/var->/private/var, which tripped the symlink-ancestor guard before the real assertions ran.scripts/resolvers/redact-doc.ts,ship/sections/pr-body.md.tmpl+ regenerated outputs/goldens): BSDmktempignoresTMPDIRfor baremktemp, so the pending-content file landed outside the test's temp root. The templates now use an explicitmktemp "${TMPDIR:-/tmp}/name.XXXXXX"(placeholder stays at the end, per the /codex temp-file creation fails on macOS (BSD mktemp): .txt suffix after XXXXXX + trailing-slash TMP_ROOT #2091 sweep).test/helpers/plan-count-fixture.ts,plan-count-file-permission.ts,claude-pty-runner.ts,plan-count-file-permission.test.ts): two distinct causes —process.cwd()kernel-resolved (/var->/private/var) while fixtures kept the symlinked spelling, so transcript records and hook events never matchedrecord.cwd === cwd. The fixture now resolves its cwd once so every consumer sees the same spelling.runPlanSkillCountingnow forwards acolsoption and the test runs at 200 columns. The recorder's tmpdir containment check also gained a canonical-path fallback (record identity checks remain exact-string).test/helpers/pty-screen.ts: importing the bundled xterm headless build via adata:URL exceeds the module-specifier length cap on newer Bun (NameTooLong); it now spools to a temp file. This was masking the real test/plan-count-file-permission.test.ts: "cropped" / "path-cropped" variants fail on macOS — fake 120-column terminal crops the path at every possible $TMPDIR #2911 symptoms behind "PTY screen unavailable".Test plan
Verified on macOS (Bun 1.3.11):
bun test test/cso-git-hardening.test.ts— 10/10 passbun test test/plan-count-file-permission.test.ts— 13/13 pass (previously 5 timeouts)bun test browse/test/chromium-profile-isolation.test.ts— 9/9 passbun test test/spec-quality-gate-secret-sink.test.ts— 12/12 passbun test test/regression-issue2091-bsd-mktemp.test.ts test/gen-skill-docs.test.ts— 444/444 pass (mktemp sweep + freshness gate)bun run gen:skill-docs— no drift; generated.mdand golden fixtures consistentbun run test(full free suite) — my changed files all pass; remaining failures are pre-existing macOS issues in untouched fixtures (same/varsymlink class in other CSO suites — happy to follow up separately)Generated with Devin