Repository navigation
test(inspector): keep the cancellation cases off an ambiguous temporary path - #10026
XiaoBinGan wants to merge 2 commits into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa4ceb594d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
aa4ceb5 to
8e079b9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e079b969a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…ry path The Inspector URL replaces quotes and backslashes with underscores, so `authorizeRuntimeTargetLocation` treats a reported path that still contains one as unprovable and refuses the target. That refusal is deliberate, but it made these cases depend on where the host puts its temporary directory: with `TMPDIR` containing an underscore the target is excluded before the stat the case aborts on, so the listing returns a result instead of cancelling. Create the fixture under a temporary root that can express a provable path, falling back to `/tmp`, and skip the cases only when no such root exists, so the cancellation behaviour is still measured rather than the refusal. Verified by running the file with `TMPDIR=/tmp/rea_under_test` (1 failed before, 5 passed after) and with a clean root (5 passed both). Full-project typecheck, `oxfmt --check` and `oxlint` are clean.
8e079b9 to
7385621
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73856215c3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Three review findings on the skip gate. **Only two cases need a provable root.** The gate skipped all five, but the Electron cancellation cases reach the same code paths without asserting a resolved path, so they were skipping work they could do. The two that compare a resolved target — the `V8InspectorProvider` case and the file-location authorization case — keep the gate; the other three run everywhere. **Existence is not writability.** The root was chosen by spelling alone, so `/tmp` on a read-only mount passed and every `mkdtemp` then failed with `EROFS` instead of skipping. The candidate is probed with `accessSync(root, W_OK)` before it is selected. **A safe alias can still resolve to an unsafe target.** The spelling was checked in its canonical form only, so a symlinked `TMPDIR` with a clean name over a target containing a space or `%` produced an encoded URL. Both the spelling and its canonical form are checked now, and the spelling is what gets returned, so the fixture keeps the path that worked. One case still fails on this Windows host — `stops Inspector target authorization after the current stat settles` — and it fails the same way on `main`; it is not caused by this change.
|
All three fixed in Only two of the five cases need a provable root. You are right that the Electron cancellation cases do not assert a resolved path — they were skipping work they could do. The Existence is not writability. The root is probed with A safe alias can resolve to an unsafe target. Both the spelling and its canonical form are checked, and the spelling is what gets returned, so a symlinked One case still fails on this Windows host ( |
|
Fixed in this push. You are right that the fallback left the verifier's sandbox: the private The fix keeps the fallback inside the private root: when |
The Inspector cancellation cases depend on where the host puts its temporary directory: with an underscore in
TMPDIRthe listing returns a result instead of cancelling.Fixes #9996.
Problem
authorizeRuntimeTargetLocationtreats a reported path that contains an underscore as unprovable, because the Inspector URL replaces quotes and backslashes with underscores:That refusal is deliberate and stays. The cases, however, build their fixture with
mkdtemp(join(tmpdir(), "rea-inspector-cancel-")), so a host whose temporary root contains an underscore makes the target be excluded before the stat the case aborts on. The case then measures the refusal instead of cancellation and fails withExpected Inspector listing cancellation.Measured on this checkout:
Approach
Create the fixture under a temporary root that can express a provable path, falling back to
/tmp, and skip the cases only when no such root exists. The intent is to keep measuring cancellation rather than the refusal, and to be explicit when the host cannot support the measurement.Evidence
TMPDIR=/tmp/rea_under_test: 1 failed before the change, 5 passed after.tsc --noEmit,oxfmt --checkandoxlintare clean on the changed file.Unavailable coverage: no Windows run, where the underscore rule does not apply and the guard is inactive. The skip branch was not exercised, because this host has a usable
/tmp.Author readiness
Human owner: @XiaoBinGan