Flake batch 19: four test races (v3 crash test, stall watchdog x2, secret fetch budget)

Merged
AF
14h ago
+107-7

Four test-only fixes for timing failures seen in merge-queue and main CI runs today.

  1. v3 base-ref crash test (v3_base_refs::a_process_killed_at_any_base_path_boundary_leaves_references_readable, macOS, #1095's group): the parent read the child's ready file as "" instead of "base-ref-marked". The parent reads the file as soon as it exists, and the child created it and then wrote the step name. The child now writes beside the file and renames it into place at all three sites.

  2. Stall watchdog (subc::stall_watchdog::tests::stalled_turn_work_snapshot_names_entry_without_waiting_for_loop, Windows, main CI on the v0.63.0 release merge): the test slept five 300 ms thresholds, then expected the watchdog's exit line, and the watchdog thread ran later on a loaded runner. It now holds the step up to 90 s and polls up to 60 s for the line while it is held.

  3. Secret fetch budget (secret_fetch::redirect_locations_that_reassemble_the_key_after_parsing_are_refused and repeated_content_encoding_fields_are_refused, Windows, #1098's group): the fetch reported a 0 ms deadline. The helpers call the outline handler directly, so they ran under bounded_io::command's 5 s IO_BUDGET (commands/outline.rs:63-72, bounded_io.rs:21,483-493). The fetch reserves 3 s of that (url_fetch.rs:249-265), leaving 2 s, which setup can use up on a loaded runner. Agent calls run under the 25 s tool-call budget (run_tool_call.rs:720). The helpers now take that budget with enter_if_absent, so shorter and expired budgets set by deadline tests are kept. The hostile-body timing test now pins its 5 s budget explicitly. Two new tests cover both cases.

  4. Ping under a locked database (subc::stall_watchdog::tests::frame_loop_answers_ping_while_watch_diagnostic_database_is_locked, Windows, main CI at 3d2e786fcb): the pong was allowed one 300 ms threshold. The database lock stays held for the whole wait, so a loop blocked on it never answers; the bound is now 30 s, which keeps that proof without failing on a loaded runner.

Checks: the v3_base_refs tests passed 3 times; the 27 stall_watchdog tests passed 3 times and again after the ping fix; the 31 secret_fetch tests passed on Linux and native Windows; the Windows target check passes.