Repository navigation
test(ci): say what the self-update test can and cannot observe - #102
Conversation
assert() returns only once the self-replace helper (which inherits the updater's pipes) has finished, so its single delete attempt is already over when the leftovers are checked: a file still present means that attempt failed, not that the helper is slow. Correct the comments and make the failure message say so. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WeiJxQWhjhQvvURAjiDkti
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Claude finished @krassx's task in 38s —— View job Review of PR #102
I didn't run the tests. The changed test is What I checked
Finding (inline, P3): the shorter 2 s wait is justified for the old binary. It is not clearly justified for the helper's own Overall risk: Low. Only comments and failure messages changed, plus a shorter test-only wait. No product code is touched. Merge recommendation: Approve. The P3 can be addressed here or in the follow-up PR about sweeping leftovers. Most important issue: the wait for the temp-dir helper copy was cut from 20 s to 2 s (see above). Positives
|
| // is slow. The short wait is only for the filesystem to settle. | ||
| let (mut left, mut in_temp) = (names_in(&bindir), names_in(&systemp)); | ||
| for _ in 0..80 { | ||
| for _ in 0..8 { |
There was a problem hiding this comment.
Severity: P3 Low
Location: tests/update_e2e.rs:520 (and the messages at 530/534)
Problem: Cutting the wait from 20 s to 2 s is only justified for the old binary, which DeleteFileW removes before cmd.exe is spawned. The other file this loop waits for is the helper's own .__selfdelete__.exe in the temp dir. That file is removed by FILE_FLAG_DELETE_ON_CLOSE when the last inherited handle closes, and that handle is held by the cmd.exe /c exit that self-replace spawns (windows.rs, self_delete_on_init). The pipes close at the same moment, so .assert() returning does not prove that deletion has completed.
Impact: Any delay in that kernel-side delete, such as a scanner holding the file, now has 2 s of slack instead of 20 s. This could make the windows-11-arm job flakier, and the new message would blame the helper's single DeleteFileW attempt for something that attempt did not do.
Scenario: The old binary is gone and only .__selfdelete__.exe is left in systemp-N at 2 s. The test fails with "the helper exited without deleting the old binary", which is the wrong diagnosis.
Fix: Either keep a longer wait for in_temp only, or word the temp-dir message to cover both files (the relocated old binary and the helper copy). I would not make this blocking.
There was a problem hiding this comment.
Stale comment
Review of PR #102
Follow-up to #100: correct the comments and failure text for the Windows self-replace e2e, and cut the leftover poll from 20s to 2s. I reviewed the diff against
tests/update_e2e.rs,src/cli/update.rs,.github/workflows/ci.yml, andself-replace1.5.0 and 1.5.1src/windows.rs(schedule_self_deletion_on_shutdown,self_delete_on_init,DeleteFileWonce,ExitProcess(1)with nocmd.exeon failure,FILE_FLAG_DELETE_ON_CLOSE+CreateProcessA("cmd.exe /c exit")withbInheritHandles=TRUE). I did not run the Windows-only test (this host is Linux). I did readgh pr checksfor this HEAD:self-update (windows-latest),self-update (windows-11-arm),test (windows-*), and clippy are green.What the PR gets right
The load-bearing claim about
.assert()is correct for the helper process:
assert_cmdusesCommand::output()→ piped stdout/stderr andwait_with_output(read to EOF).self-replacestarts the helper withCommand::new(tmp_exe).spawn()(stdio inherit), so the helper holds those write ends.- The helper’s
.CRT$XCVpathWaitForSingleObject(parent)then oneDeleteFileW. It never retries in 1.5.0 or 1.5.1.- EOF therefore cannot happen until the helper has already made that attempt (and, on the success path, until
cmd.exehas also dropped the inherited pipe handles).So the old “helper makes its single attempt after we poll” / “
--test-threads=1is so we watch that attempt” comments were wrong.--test-threads=1still serializes the crate (clearer--nocapturelogs, less AV overlap with the sentinel test); it does not change the helper’s retry policy. Poll-before---versionfrom #100 is unchanged. No product code in this PR.Finding
P3 Low —
tests/update_e2e.rs:514-520(messages at 530 / 534–536). See inline. In short: leftovers are not only “DeleteFileWfailed.” Delete-pending names (relocated PE and.__selfdelete__.exe) remain visible until handles other than the pipes close. The 80→8 loop is a behaviour change; the new messages over-claim permanence. Not blocking given green Windows jobs on this HEAD and #103 stacked to sweep / relax this assertion.Note: the PR body says “comments and failure messages only; no behaviour change.” The loop bound is a behaviour change. Worth correcting in the description so reviewers do not skip the wait cut.
Verdict
- Overall risk: Low — test comments/messages + a shorter test-only wait;
bugsee-cli updateis unchanged.- Merge recommendation: Approve. The P3 can land as-is or be folded into #103 (which already replaces the “failed delete can never happen” assertion).
- Most important to fix: Optional — do not treat a 2s
read_dirleftover as proof the singleDeleteFileWfailed; keep a longerin_tempbound or name both leftover kinds.- Positives: The stdio / single-attempt analysis matches the crate; the CI comment no longer implies
--test-threads=1changes helper behaviour; the PR is explicit that run 41677155537 is a product leftover, not a slow helper.Sent by Cursor Automation: Bugsee code review
The helper's own .__selfdelete__.exe is removed when the last handle to it closes, which assert() returning does not prove. Keep the 20s wait and soften the failure message accordingly. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WeiJxQWhjhQvvURAjiDkti
|
Claude finished @krassx's task in 19s —— View job Review of PR #102 (re-review after the latest push)I didn't run the tests. The changed test is Earlier finding: fixed. Commit New findings: none worth an inline comment. What I checked in the new state
1. Overall risk: Low. Comments and failure messages only, with no behaviour change. 2. Merge recommendation: Approve. I can't submit a formal approval. 3. Most important issues to fix: none. 4. Positives
|
There was a problem hiding this comment.
Review of PR #102 (re-review of d11dbcf)
Follow-up to #100: correct what the Windows self-replace e2e claims it can observe. I re-reviewed HEAD d11dbcf against tests/update_e2e.rs, src/cli/update.rs, .github/workflows/ci.yml, and self-replace 1.5.0 and 1.5.1 src/windows.rs (schedule_self_deletion_on_shutdown, self_delete_on_init, one DeleteFileW, ExitProcess(1) with no cmd.exe on failure, FILE_FLAG_DELETE_ON_CLOSE + CreateProcessA("cmd.exe /c exit") with bInheritHandles=TRUE). This host is Linux, so I did not run the Windows-only test. I did read CI for this HEAD: both self-update (windows-*) jobs succeeded; test (windows-11-arm), clippy, rustfmt, and e2e succeeded.
The prior P3 on 5f4a48d (80→8 wait + “nothing will remove it later”) is fully addressed. The loop is 80 × 250ms again, the comment now names the helper copy / DELETE_ON_CLOSE / a scanner handle, and the bindir message no longer assigns a cause. Versus main, this is comments and assertion strings only; the wait bound is unchanged.
What the PR gets right
The load-bearing claim about .assert() is still correct for the helper process:
assert_cmdusesCommand::output()→ piped stdout/stderr,wait(), thenread_to_enduntil EOF.self-replacestarts the helper withCommand::new(tmp_exe).spawn()(stdio inherit), so the helper holds those write ends.- The helper’s
.CRT$XCVpathWaitForSingleObject(parent)then oneDeleteFileW. It never retries in 1.5.0 or 1.5.1. - On the success path,
cmd.exealso inherits the pipes, so EOF cannot happen until that process has dropped them too.
So the old “helper makes its single attempt after we poll” / “--test-threads=1 is so we watch that attempt” comments were wrong. --test-threads=1 still serializes the crate (clearer --nocapture logs, less overlap with the other update tests); it does not change the helper’s retry policy. Poll-before---version from #100 is unchanged. No product code, wire shapes, exit codes, or --help text in this PR.
Findings
None (no P0–P3).
Not re-raised: the temp-dir panic still parenthesizes “a failed delete is never retried.” That is the right diagnosis for a hard DeleteFileW miss of .__relocated__.exe. It is slightly wrong if the leftover after 20s is a scanner-held .__selfdelete__.exe. The comment above the loop already covers that case, the wait matches main, and the ARM leftover from run 41677155537 is a product issue for #103. Test-only diagnostic; not a failure scenario this change introduces.
Verdict
- Overall risk: Low — comments and failure messages;
bugsee-cli updateis unchanged. - Merge recommendation: Approve.
- Most important to fix: Nothing in this PR.
- Positives: The stdio / single-attempt analysis matches the crate; the restored wait matches what the pipes do not cover; the CI comment no longer implies
--test-threads=1changes helper behaviour; the PR is explicit that run 41677155537 is a product leftover, not a slow helper.
Sent by Cursor Automation: Bugsee code review
Unity Mono portable pdb -> BMF upload (#86, #99), Windows self-update leftover sweep (#103), panic exit codes 1/50 (#98), self-replace 1.5.1 (#97), Windows self-update CI (#100, #102). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WeiJxQWhjhQvvURAjiDkti


What
Follow-up to #100, which was merged while a review finding was still open. Comments and failure messages only; no behaviour change.
assert_cmd's.assert()returns only once every holder of the child's stdout/stderr has closed them, and theself-replacehelper (and itscmd.exe) inherit those pipes. So the helper's singleDeleteFileWattempt, whichself-replace1.5.0 and 1.5.1 never retry, is already over when the test looks at the directory. Consequences:--test-threads=1were wrong;.__selfdelete__.exegoes only when its last handle closes, which the pipes do not cover.Not fixed here
The
self-update (windows-11-arm)job failed once with both helper files left in%TEMP%(run 41677155537). That is probably something outside the test (e.g. a scanner) beating the helper's one delete; it is not confirmed. The product-side answer is in the follow-up PR that sweeps the leftovers on the next update.🤖 Generated with Claude Code
https://claude.ai/code/session_01WeiJxQWhjhQvvURAjiDkti