test(worktree-helper): wait on a deadline for the scheduled orphan removal - #2669
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…e wait helper's comment
Review disposition (beta-platform-integrity lane, T3 gate)Fresh-context adversarial review at 153531b: SHIP. No CRITICAL or HIGH. Confirmed: the assertion predicate is unchanged ( Fixed (eb9a67f, comment only)
Tracked in #2670 (pre-existing, outside this diff)
Declined
GateNot measured by the reviewer (no shell): 90 s sufficiency on the hosted runner. The hosted |
Summary
Docs Governance / Worktree Helper (Windows PowerShell)reddened PR #2662 at5cd7f5e50(run 33951635415, job 101267419144) in the late-branch-collision scenario ofscripts/git/Test-New-CodexIssueWorktree.ps1: "Late branch collision must not leave an orphan helper-created worktree." The scenario asserted that the orphan worktree directory was gone after a fixed poll of 50 x 100 ms (5 seconds). The initializer hands that removal to a hidden, detached PowerShell host (Initialize-CodexIssueWorktree.ps1lines 170 to 214) that re-verifies the worktree's top level, common directory and HEAD, re-inventories tracked, untracked, ignored and index-hidden content, and only then runsgit worktree remove: one host start, a poll until the initializer process exits, and seven Git invocations against a fresh checkout, which the hosted runner did not finish in 5 seconds. The printed "removal ... was scheduled" assertion passed and the registration check never ran, so the failure says nothing about the cleanup itself.This PR replaces that poll, and the separate-Git-dir sibling with the identical shape and a 10 second ceiling, with one
Wait-ForScheduledWorktreeRemovalhelper: a 90 second deadline (the same pattern the suite already uses at its 30 and 45 second waits), 100 ms polling, and a result carrying elapsed seconds. The assertions keep their meaning (a genuine orphan still fails), and the failure message now includes the elapsed wait and the currentgit worktree list --porcelainso a real orphan is diagnosable from the job log. The initializer, its timeout value and the refused-cleanup scenarios are unchanged.scripts/git/**is not an SC-10 control path (.github/workflows/**,ci/**,scripts/ci/**, lockfiles, security config), so this is a normal T3 PR.Verification
powershell -NoLogo -NoProfile -NonInteractive -File scripts/git/Test-New-CodexIssueWorktree.ps1):PASS: 29/29 selected worktree helper regression checks, exit 0. Scenario 11 (the collision scenarios) and scenario 29 passed on the new helper.git diff --check: clean.invalid-branch): itsissue-471/COM¹case is passed on the command line and the child host decoded the superscript differently from Git, so the helper's generic branch-name check fired before the Windows-compatibility diagnostic. The same file, same commit, native host: green. That is a launch-encoding artifact of the Bash-hosted run, not a suite defect, and it is unrelated to this diff.Not verified
Closes #2664. Refs #2425, #2378, PR #2662.