Repository navigation
Fix Windows flake in notifier dead-endpoint e2e test - #1392
Conversation
dead_endpoint_never_fails_the_command asserts that the failed update check rewrote lastCheckAt, but that write happens in the detached background task. The row used eligible_kit, which keeps the production 500 ms join grace, so on a loaded Windows runner the child could exit before the task's save_state ran and the test read back the seeded STALE value (Windows test leg on run 37972832939). Use eligible_kit_await_fetch like every other row that asserts on the background task's effect. The fetch itself stays capped at 2 s, and grace_budget_bounds_command_latency still covers the real 500 ms ceiling. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWAaQAvuYc8RATeyXGm8rs
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 25c1633. Configure here.
|
Ready for review at
Generated by Claude Code |
Final review briefWhat it does. Test-only fix for a Windows flake. Risk: low. One test changed, no product code. The endpoint is Look here
Verified. Read the diff and the helper. The test's assertions are unchanged; only the grace is lifted, which matches the rows at L136, L203, L235, L301 and L332. CI 53/53 green (35 pass, 18 skipped) on 25c1633, Windows included; Cursor Bugbot: no new issues. CHANGELOG untouched. Changes I made. None. Open questions. None. Auto-merge is armed: approving sends it straight to the merge queue. Generated by Claude Code |
Problem
update_notifier_e2e::dead_endpoint_never_fails_the_commandflakes on the Windowstestleg:Seen on run 37972832939 (
test (windows-latest, 2),--test update: 52 passed, 1 failed) on an unrelated docs PR.lastCheckAtis the STALE value the test seeds (~25h old), so the state file was never rewritten. It has hit a PR so far, not the merge queue. But this test runs on the Windows leg inmerge_grouptoo, and there each flake evicts an entry and costs a full rebuild.Root cause
The
lastCheckAtwrite happens inrefresh_latest, which runs in a detachedtokio::spawn.finishjoins it under the production 500 ms grace, and then the child callsprocess::exit. This row usedeligible_kit, which keeps the 500 ms grace. On a loaded Windows runner the task can miss the window and get killed beforesave_statelands. The comment oneligible_kit_await_fetchdescribes this same race. Every other row that asserts on the background task's effect already uses that helper; this one was missed.Fix
Use
eligible_kit_await_fetch("http://127.0.0.1:1")in this test, and add a doc note explaining why. No assertion changes:lastCheckAt. Only the pre-fetch write exists on the failure path.grace_budget_bounds_command_latencystill pins the real 500 ms ceiling.Proof
To simulate a runner where the task misses the window, I added
SOCKET_UPDATE_GRACE_MS=0toeligible_kitlocally (the change is not committed), then looped the test 20x:cargo test -p socket-patch-cli --test update update_notifier_e2e: 19 passed.cargo clippy -p socket-patch-cli --test update -- -D warnings: clean.rustfmt --checkon the touched file: clean.No tests were removed or moved.
🤖 Generated with Claude Code
https://claude.ai/code/session_01UWAaQAvuYc8RATeyXGm8rs
Generated by Claude Code
Note
Low Risk
Test-only change to e2e harness timing; no production notifier or CLI behavior is modified.
Overview
Fixes intermittent Windows CI failures in
dead_endpoint_never_fails_the_commandby aligning it with other notifier e2e tests that assert on background-check side effects.The test now uses
eligible_kit_await_fetch(liftedSOCKET_UPDATE_GRACE_MS) instead ofeligible_kit, so the child process waits for the detached update check to finish writinglastCheckAtbefore exit. Assertions are unchanged—the unreachable host still uses a 2s fetch cap; only the join grace is relaxed to avoid reading the seeded STALE timestamp when the runner is slow.Doc comments on the test explain why the lifted grace is required.
Reviewed by Cursor Bugbot for commit 25c1633. Configure here.
Generated by Claude Code