From 25c16338173557d9e5ac5692ad6d673a7f2bf1f2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 11 Oct 2026 16:03:03 +0000 Subject: [PATCH] Await the notifier fetch in the dead-endpoint test 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) Claude-Session: https://claude.ai/code/session_01UWAaQAvuYc8RATeyXGm8rs --- .../tests/update/update_notifier_e2e.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/socket-patch-cli/tests/update/update_notifier_e2e.rs b/crates/socket-patch-cli/tests/update/update_notifier_e2e.rs index 4e679d76a..54889b6fb 100644 --- a/crates/socket-patch-cli/tests/update/update_notifier_e2e.rs +++ b/crates/socket-patch-cli/tests/update/update_notifier_e2e.rs @@ -500,13 +500,21 @@ async fn guard_opt_out_beats_force() { /// Unreachable release host: the carrier is untouched, and the FAILED /// check still advances `lastCheckAt` — a broken network is retried at /// most once a day, not on every command. +/// +/// The `lastCheckAt` write happens in the detached check task, so this row +/// asserts on the task's effect and needs the lifted grace like the others +/// (under 500 ms a loaded Windows runner could exit before the write and +/// read back the STALE value). The fetch itself stays capped at 2 s. #[tokio::test] async fn dead_endpoint_never_fails_the_command() { let install = staged_install(); write_state(&install.state_dir, STALE, Some(CURRENT), None); - let (code, stdout, stderr) = - run_installed(&install, &["apply"], &eligible_kit("http://127.0.0.1:1")); + let (code, stdout, stderr) = run_installed( + &install, + &["apply"], + &eligible_kit_await_fetch("http://127.0.0.1:1"), + ); assert_eq!(code, 0, "stdout:\n{stdout}\nstderr:\n{stderr}"); assert!(!stderr.contains("Update available"), "{stderr}");