Skip to content

test: canonicalize the statechart symlink fixture directory - #1136

Closed
aranlucas wants to merge 1 commit into
cursor:mainfrom
aranlucas:fix/macos-symlink-fixture-20261029
Closed

aranlucas wants to merge 1 commit into
cursor:mainfrom
aranlucas:fix/macos-symlink-fixture-20261029

Conversation

@aranlucas

@aranlucas aranlucas commented Oct 29, 2026 •

Copy link
Copy Markdown

Summary

The statechart launcher's relative-symlink test fails on macOS because os.tmpdir() can return /var/folders/..., while /var resolves to /private/var. path.relative counts lexical path segments, creating a dangling link; spawnSync returns ENOENT before the launcher runs.

- const links = fs.mkdtempSync(path.join(os.tmpdir(), "statechart-links-"));
+ const links = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), "statechart-links-")));

Canonicalize the temporary directory before constructing the relative link. Regenerate the shipped harness with the existing native command node scripts/generate-pstack-harness-trees.mjs. No new scripts or runtime launcher behavior changes.

Evidence

  • Before: the focused Node 22 symlink case fails on macOS with spawn ENOENT and undefined stderr.
    After: the case passes and the full CI test command exits 0 under Node 22.23.4: 334 tests, 267 passed, 67 existing skips, 0 failed.
  • Plugin validation, generated harness freshness, and git diff --check pass.
  • The first post-change focused run hit an intermittent SIGINT assertion in a separate case; the completed full suite subsequently passed it. No skips or assertions changed.

Merge Danger

Door: two-way

Blast Radius: tests

Only the fixture and generated harness copy change.


Note

Low Risk
Test-only fixture change with no impact on launcher runtime or production code paths.

Overview
Fixes a macOS-only flake in the launcher test that exercises absolute and relative symlinks to statechart.

The linkedLauncher helper now wraps the temp directory from mkdtempSync with fs.realpathSync before building paths and a relative symlink via path.relative. On macOS, os.tmpdir() can sit under /var/folders/... while the real path is under /private/var, so a non-canonical base produced a broken relative link and the test saw spawn ENOENT before the launcher ran.

No production launcher or runtime behavior changes—only the test fixture setup.

Reviewed by Cursor Bugbot for commit 8d77413. Bugbot is set up for automated code reviews on this repo. Configure here.

@aranlucas aranlucas closed this Oct 29, 2026
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