Repository navigation
Conversation
… dirs authorizeRuntimeTargetLocation treats a Node-reported POSIX path containing '_', '"' or '\' as unverifiable, because Node's Inspector discovery metadata replaces quotes and backslashes with underscores. The javascriptRuntimeObservation and javascriptRuntimeTargetLocations fixtures were created under realpath(os.tmpdir()). On macOS that is a per-user directory of the shape /private/var/folders/<x>/<y>/T, where <y> often contains '_', so four tests could never verify their own fixture there; Linux's /tmp has no such characters. createNodeDiscoveryTempDirectory uses the canonical temporary directory when it is free of those characters, otherwise the canonical /tmp, and fails when neither is. Windows keeps createTestTempDirectory. No assertion changes; the product rule that such paths are unverifiable is unchanged and still tested. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolving realpath("/tmp") unconditionally rejects on a POSIX host without
/tmp even when tmpdir() is clean, failing both inspector test files before
they create a fixture. Resolve the primary first and fall back to /tmp only
when it contains '_', '"' or '\'.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Kenmege
force-pushed
the
fix/macos-node-discovery-tmpdir
branch
from
October 16, 2026 14:52
a257c3b to
813d8a0
Compare
11 of 22 tasks
Owner
|
Thanks for identifying the macOS temporary-path interaction. The Inspector path owner still treats ambiguous discovery spellings as unresolved, so this test-fixture issue remains distinct. GitHub reports a conflict; could you refresh the fixture change against main and preserve both safe temporary-directory ownership and the explicit ambiguous-path coverage? Please distinguish any real macOS run from simulated or source-only checks. |
2 tasks done
3 tasks done
gensokyo-dev
added a commit
that referenced
this pull request
Nov 14, 2026
…rscored roots Use createNodeDiscoveryTempDirectory for the target-location and runtime-observation fixtures too, so a TMPDIR containing `_` cannot make them fail for the same reason as the cancellation test. Refs #9996 The sibling sites are the ones #4484 switched. Co-Authored-By: gensokyo-dev <[email protected]>
N0zoM1z0
pushed a commit
that referenced
this pull request
Nov 14, 2026
…rscored roots Use createNodeDiscoveryTempDirectory for the target-location and runtime-observation fixtures too, so a TMPDIR containing `_` cannot make them fail for the same reason as the cancellation test. Refs #9996 The sibling sites are the ones #4484 switched. Co-Authored-By: gensokyo-dev <[email protected]>
Collaborator
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
Four inspector boundary tests cannot pass on macOS hosts whose per-user temporary directory contains an underscore. Their fixtures are created under
realpath(os.tmpdir()), and REA deliberately treats a Node-reported path containing_as unverifiable. This keeps those fixtures in a temporary directory whose canonical path cannot be confused with Node's lossy rewriting. Test-only change; no product behaviour changes.Problem and expected behavior
authorizeRuntimeTargetLocation(src/inspector/JavaScriptRuntimeScope.ts) marks a Node-reported POSIXfile://path containing_,"or\asunverifiable-file-location, because Node's Inspector discovery metadata replaces quotes and backslashes with underscores. That rule is correct and unchanged.On macOS,
os.tmpdir()is a per-user directory of the shape/private/var/folders/<x>/<y>/T, and<y>often contains_. Every fixture thatcreateTestTempDirectorycreates there is therefore reported as unresolved. These tests expect a verifiedfilelocation, so they fail on such hosts:javascriptRuntimeObservation.test.ts: "includes targets outside the old caller root filter"javascriptRuntimeTargetLocations.test.ts: "interprets entry#hash.js / entry%percent.js / entry%23hash.js as a literal Node discovery path on POSIX"Linux
/tmpcontains none of those characters, so the tests pass there.Change and scope
tests/fixtures/temporaryDirectory.tsgainscreateNodeDiscoveryTempDirectory(prefix):_,"and\. Only otherwise does it resolve the canonical/tmp, so a host without/tmpstill works whentmpdir()is clean.createTestTempDirectory, since Node discovery paths are never verified there.onTestFinished→removeTestWorkspacepath.The two inspector test files use it for their fixture roots. No assertion changes.
Contribution scope: an ordinary test fix within existing boundaries; a maintainer scope decision is not applicable.
Contract and boundary impact
/private/tmp.Evidence and regression coverage
TMPDIRcontains_, Node 24.18.0 from.nvmrc):npx vitest run tests/boundary/inspector/javascriptRuntimeObservation.test.ts tests/boundary/inspector/javascriptRuntimeTargetLocations.test.tsat fe2a398 fails 4 of 38 tests, the 4 named above. Each receives{ kind: "unresolved", reason: "unverifiable-file-location" }.realpath(os.tmpdir())exactly as before, unless TMPDIR itself contains_,"or\. On Windows it is the old helper. CI covers both.Validation performed
npx vitest runon the two files at fe2a398: 4 failed / 34 passed (38).TMPDIR(primary used).npm run check:fast: passed (2/2 tasks).npm run check: passed (6/6 tasks; architecture guards passed across 1455 source files).npm run verify:test-discovery: discovered all 1417 test files exactly once.Compatibility, safety, and release
Author readiness
Human owner: @Kenmege (the declarations below are left for the human owner, per the template)
Before merge
type(scope): outcome.