Repository navigation
test(plugin-profiles): cover the settings-file rename retry on the Windows lane - #17608
Conversation
A new atomic-file suite refuses renameSync through the builtin module's live binding: on Windows a rename refused with EPERM, EBUSY or EACCES is retried and replaces the file, and a rename refused every time fails after five tries through writeSettings with the settings file unchanged and no temp file left. Off Windows the same refusals fail on the first try, and an error outside those codes is never retried. Refs: #16455 Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgf4hSWe3ViMaDA9Fp9
…dows The settings writer retries a refused rename only on win32, so the atomic-file suite gets a step in test-windows-guards, the job with the smallest measured total, and a plan line keyed like the write-snapshot step. The step calls node directly: the .test.sh wrapper exits 0 when node is missing. Refs: #16455 Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgf4hSWe3ViMaDA9Fp9
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. |
|
claude-security-review reviewed Security review: PR #17608I found no security issues. I read every hunk of all 5 changed files. None of them matches a trusted-path glob. What changed
What I checked
Spend. One small extra step in an existing Windows job (an estimated 2 s per run). That uses Actions minutes on the existing runner, not a new billed resource, so it is not a hold. critical-findings: 0 |
|
claude-review reviewed Code review: no findingsThis PR adds a test suite for the plugin-profiles settings-file rename retry and wires it into the Windows platform lane. I found nothing that meets the bar. What I checked
Not verified by me: the author says the planner selects this suite for changes to Closing issue: the PR refers to #16455 and does not close it. The PR context has no closing-issue section, so there were no acceptance criteria to check. Spend: adds one Loosened-check verdict: fail (lane default; no Verifier dropped 0 of 0 candidates. |
Refs: #16455
Summary
Covers the plugin-profiles settings-file rename retry on the Windows platform lane (AC8 and AC21 of #16429), and records the
status --jsontiming on the owner's machine.As the machine stands, with no profile recorded,
status --jsontakes well under 2 s. The path where a profile is recorded was not measured directly. The child process that path adds took 1.3 to 2.2 s on its own, so that path is near or over the 2 s bar. For that reason this PR refers to #16455 instead of closing it (see Remaining).Fix
plugins/plugin-profiles/lib/atomic-file.test.mjswith its.test.shwrapper. The suite replacesfs.renameSyncand callssyncBuiltinESMExports(), so the live binding inlib/atomic-file.mjsrefuses renames on demand on every OS:writeSettings: on Windows it fails after 5 calls; on every OS the settings file keeps its bytes and no temp file is left (AC8, AC21)..github/workflows/pr-test-platforms.yml: a step intest-windows-guards, the job with the smallest measured total, runsnode --teston the suite directly, because the wrapper exits 0 when node is missing. The job-time table and the paragraph on why each suite runs on Windows now include it.scripts/test-windows-plan.txt: the step's plan line, keyed like the write-snapshot step..changes/plugin-profiles/: abump: nonefragment (test and CI only).Verification
node --test --test-concurrency=4 plugins/plugin-profiles/lib/atomic-file.test.mjs: 5 pass on Linux.process.platformset towin32in a scratch runner: 5 pass. The retried cases take about 150 ms and the always-refused case about 506 ms, which matches the 50, 100, 150 and 200 ms pauses.bash scripts/plan-test-lanes.sh -- plugins/plugin-profiles/lib/atomic-file.mjs plugins/plugin-profiles/lib/settings-io.mjs:windows_stepsincludesplugins/plugin-profiles/lib/atomic-file.test.mjs, andwindows_jobsincludestest-windows-guards.bash scripts/plan-test-lanes.test.sh: PASS=69 FAIL=0, which includes the live check that the workflow'sif:keys match the plan.actionlint .github/workflows/pr-test-platforms.yml: clean.bash scripts/check-affected.sh: 18 passed, 2 skipped.Test Windows Guardsjob once the PR is ready. Draft PRs run no platform jobs.status --jsontimingMachine: the owner's workstation, WSL2 (Linux), 24 CPUs, node v24.21.0, Claude Code 2.1.329, on commit d71cd50. Each row is
hyperfine --warmup 2 --runs 15. The load average column shows how busy the machine was with parallel sessions.node plugins/plugin-profiles/scripts/profiles.mjs status --json(repo root; no profile recorded for the folder or as initial)claude plugin list --json(the child process status adds when a profile is recorded)Remaining
statusreads the installed plugins throughclaude plugin list --json.recordedStatuscallsrecords()to computeinstalledSince, and that resolves torecordsFromCliand aspawnSyncof claude. On this machine that call alone took a mean of 1.5 s, with a maximum of 2.2 s at light load and 3.8 s under heavy load. Astatus --jsonwith a profile in force is therefore expected to be near or over 2 s. That is an estimate from the child process: no profile was applied here, because applying one writes this machine's settings.statusread the records from disk the way the session-start path already does (recordsFromDisk).Related
scripts/profiles.test.mjsskips on win32, and the new suite covers that gap.renameWithRetry.🤖 Generated with Claude Code