Skip to content

test(inspector): keep the cancellation fixture out of underscored temp roots - #10118

Closed
MuhammadFaizan-prog wants to merge 1 commit into
morluto:mainfrom
MuhammadFaizan-prog:fix/9996-cancellation-temp-root
Closed

MuhammadFaizan-prog wants to merge 1 commit into
morluto:mainfrom
MuhammadFaizan-prog:fix/9996-cancellation-temp-root

Conversation

@MuhammadFaizan-prog

@MuhammadFaizan-prog MuhammadFaizan-prog commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #9996. Related: #7056, #4484 (same helper; this is rebased onto current main and limited to the cancellation test, per the request for one fixture owner). Happy to close this in favour of #7056 if you'd rather land that one.

Problem and expected behavior

authorizeRuntimeTargetLocation intentionally never stats a Node-reported POSIX path containing _, " or \. The cancellation test builds its fixture under tmpdir(), so an underscored temporary root (common on macOS, or any TMPDIR with _) leaves both targets unresolved, the abort set for the second stat never fires, and listTargets succeeds: Error: Expected Inspector listing cancellation.

Change and scope

  • tests/fixtures/temporaryDirectory.ts: createNodeDiscoveryTempDirectory(prefix) uses canonical tmpdir() when it is free of those characters, otherwise canonical /tmp, and throws if the created directory is still ambiguous. Windows uses createTestTempDirectory. Cleanup is onTestFinished → removeTestWorkspace.
  • The cancellation test uses it and drops its own roots/afterEach removal (CONTRIBUTING: one deletion owner). No assertion changes.
  • Not changed: the lossy-path rule in JavaScriptRuntimeScope.ts. Not included: the boundary inspector tests covered by test(inspector): keep Node discovery fixtures out of underscored temp dirs #4484, and Windows behavior of this file.

Contribution scope: ordinary test fix within existing boundaries; maintainer scope decision not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: test fixtures only.
  • Contribution scope fit and linked maintainer decision: not applicable (test-only fix).
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: none in product code.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details: fixture root has an owned rea- prefix and is removed by onTestFinished.
  • Generated metadata, package, or installation impact: none.

Evidence and regression coverage

  • Tests added or updated: src/inspector/JavaScriptRuntimeScope.cancellation.test.ts (fixture root only).
  • Base reproduction: on main 0909d89c, Linux aarch64, Node 24.22.1, TMPDIR=<work>/bad_root npm run test:local -- src/inspector/JavaScriptRuntimeScope.cancellation.test.ts → 1 failed / 4 passed (Expected Inspector listing cancellation, line 142); <work>/goodroot → 5 passed.
  • Remaining proof gaps: macOS and Windows not run; typecheck not run locally (see below); the "no clean root" error branch not exercised.

Validation performed

Linux aarch64, Node 24.22.1, isolated HOME/XDG:

  • TMPDIR=<work>/bad_root npm run test:local -- src/inspector/JavaScriptRuntimeScope.cancellation.test.ts: before 1 failed / 4 passed; after 5 passed
  • TMPDIR=<work>/goodroot npm run test:local -- src/inspector/JavaScriptRuntimeScope.cancellation.test.ts: before and after 5 passed
  • npx oxfmt --check and npx oxlint on the two files: passed, 0 findings
  • No rea-inspector-cancel-* directories left in /tmp after the run
  • npm run check:fast: not completed locally (typecheck ran out of memory); relying on CI

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: Linux aarch64 only.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: test-only; inert files under an owned temporary directory.

Author readiness

Human owner: @MuhammadFaizan-prog

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

AI disclosure: prepared with AI assistance (Hark); I review and own the final diff.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T17:56:13.232697Z e159e22 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@MuhammadFaizan-prog MuhammadFaizan-prog changed the title test(inspector): keep the cancellation fixture out of underscored temp rootsconstruction contract: none. test(inspector): keep the cancellation fixture out of underscored temp roots Nov 11, 2026
@MuhammadFaizan-prog
MuhammadFaizan-prog marked this pull request as draft November 11, 2026 16:48
@MuhammadFaizan-prog
MuhammadFaizan-prog marked this pull request as ready for review November 11, 2026 17:53
gensokyo-dev added a commit that referenced this pull request Nov 14, 2026
N0zoM1z0 pushed a commit that referenced this pull request Nov 14, 2026
@N0zoM1z0

Copy link
Copy Markdown
Collaborator

Thank you! Your cancellation-fixture change landed with authorship kept in #10568 (rebase-merged), which fixes #9996. The sibling Node discovery fixtures now use the same helper (583bb47). Closing as superseded.

@N0zoM1z0 N0zoM1z0 closed this Nov 14, 2026
@morluto morluto added the area: tests Test suite and verification label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Test suite and verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Inspector cancellation test fails when TMPDIR contains an underscore

3 participants