Repository navigation
fix(pstack): make the statechart tests pass when TMPDIR is a symlink or LD_PRELOAD is unavailable - #924
Open
oesni wants to merge 1 commit into
Open
fix(pstack): make the statechart tests pass when TMPDIR is a symlink or LD_PRELOAD is unavailable#924oesni wants to merge 1 commit into
oesni wants to merge 1 commit into
Conversation
…or LD_PRELOAD is unavailable Fixes cursor#923.
|
Hey @oesni, #977 replaced the |
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.
Fixes #923.
Two assumptions in
statechart.test.mjsbreak the suite outside a plain Linux/tmp. Only the test file changes. The statechart scripts are unchanged.tmpdir(), while the script sees its cwd with symlinks resolved. WhenTMPDIRgoes through a symlink, which is the default on macOS (/var->/private/var), path comparisons andrel()output no longer match. The test file now definestmpdirasrealpathSync(os.tmpdir()), so every temp folder the tests make is already resolved. The 119 call sites stay as they are.LD_PRELOAD, which only the Linux dynamic loader honors. They skipped only when the library failed to compile, so on macOS they ran and failed. The preload is now built only on Linux, and elsewhere these tests skip with "needs LD_PRELOAD on Linux, or cannot compile a rename preload". That covers five tests. Four of them failed on macOS. The fifth, "a run on a filesystem that cannot rename copies its files into place", expects exit 0, so it passed there only becauserenamewas never made to fail.Validation, full
statechart.test.mjs(150 tests) with TLC 1.7.4:mainnode:22-bookworm, default/tmpTMPDIRset to a symlinkTMPDIROn Linux the rename tests still run and pass. The five skips there are the same tests as on
main; they need mise, extra fonts or a PID namespace, which the container lacks. On macOS the nine skips are the original four plus the five rename tests.node scripts/generate-pstack-harness-trees.mjsupdated the Claude Code copy, and--check,node scripts/validate-plugins.mjsandgit diff --checkpass.Note
Low Risk
Test-only changes with no production statechart script modifications.
Overview
Fixes statechart integration tests that assumed a canonical
/tmppath and thatLD_PRELOADrename injection always works.Test temp directories now use
realpathSync(os.tmpdir())via a localtmpdir()helper, so paths match what the statechart CLI resolves whenTMPDIRis symlinked (e.g. macOS/var→/private/var). Existingjoin(tmpdir(), …)call sites are unchanged.The rename-failure preload shim is only built on Linux; on other platforms
failingRenamesisnulland the fiveLD_PRELOAD-dependent tests skip with an updated message instead of running and failing.Reviewed by Cursor Bugbot for commit d78323d. Bugbot is set up for automated code reviews on this repo. Configure here.