From e88220f207d2ec8828b14f5bc3a3c53267478617 Mon Sep 17 00:00:00 2001 From: HackingGate Date: Tue, 27 Oct 2026 00:49:13 +0900 Subject: [PATCH 1/3] The pending-baseline test renames its baseline into place, as SessionStart does Written in place, the file exists empty for an instant, and a Stop polling for it read that instant as an unreadable baseline: main's coverage run failed stop_waits_for_a_baseline_that_is_still_being_written that way. Claude-Session: https://claude.ai/code/session_01BHpLckRt4BNGCdFG9vLyEP --- tests/hook_cli.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/hook_cli.rs b/tests/hook_cli.rs index ca83f09..1ae0263 100644 --- a/tests/hook_cli.rs +++ b/tests/hook_cli.rs @@ -1339,7 +1339,12 @@ fn stop_waits_for_a_baseline_that_is_still_being_written() { std::thread::spawn(move || { std::thread::sleep(std::time::Duration::from_secs(1)); let baseline = r#"{"ran":[["test","!","-e","red"]],"red":[["test","!","-e","red"]]}"#; - std::fs::write(directory.join("s-wait.json"), baseline).unwrap(); + // Renamed into place, as `SessionStart` writes it: written in + // place, the file exists empty for an instant, and a Stop polling + // for it can read that instant as an unreadable baseline. + let partial = directory.join("s-wait.json.partial"); + std::fs::write(&partial, baseline).unwrap(); + std::fs::rename(&partial, directory.join("s-wait.json")).unwrap(); std::fs::remove_file(directory.join("s-wait.pending")).unwrap(); }) }; From e2b54a997afd2d69a161a008407ea702ed69512a Mon Sep 17 00:00:00 2001 From: HackingGate Date: Wed, 28 Oct 2026 21:37:11 +0900 Subject: [PATCH 2/3] Say why the test renames its baseline into place, in one sentence each Claude-Session: https://claude.ai/code/session_01BHpLckRt4BNGCdFG9vLyEP --- tests/hook_cli.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/hook_cli.rs b/tests/hook_cli.rs index 1ae0263..92dcaf9 100644 --- a/tests/hook_cli.rs +++ b/tests/hook_cli.rs @@ -1339,9 +1339,9 @@ fn stop_waits_for_a_baseline_that_is_still_being_written() { std::thread::spawn(move || { std::thread::sleep(std::time::Duration::from_secs(1)); let baseline = r#"{"ran":[["test","!","-e","red"]],"red":[["test","!","-e","red"]]}"#; - // Renamed into place, as `SessionStart` writes it: written in - // place, the file exists empty for an instant, and a Stop polling - // for it can read that instant as an unreadable baseline. + // Renamed into place, as `SessionStart` writes it. Written in + // place instead, the file exists empty for an instant, and a Stop + // polling for it can read that instant as an unreadable baseline. let partial = directory.join("s-wait.json.partial"); std::fs::write(&partial, baseline).unwrap(); std::fs::rename(&partial, directory.join("s-wait.json")).unwrap(); From 135f4ee50e062409971009559ab78eb1266b564d Mon Sep 17 00:00:00 2001 From: HackingGate Date: Wed, 28 Oct 2026 21:39:46 +0900 Subject: [PATCH 3/3] Say why the partial baseline has another name Claude-Session: https://claude.ai/code/session_01BHpLckRt4BNGCdFG9vLyEP --- tests/hook_cli.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/hook_cli.rs b/tests/hook_cli.rs index 92dcaf9..f6cb89c 100644 --- a/tests/hook_cli.rs +++ b/tests/hook_cli.rs @@ -1342,6 +1342,7 @@ fn stop_waits_for_a_baseline_that_is_still_being_written() { // Renamed into place, as `SessionStart` writes it. Written in // place instead, the file exists empty for an instant, and a Stop // polling for it can read that instant as an unreadable baseline. + // The partial file's name is not the baseline's, so no poll opens it. let partial = directory.join("s-wait.json.partial"); std::fs::write(&partial, baseline).unwrap(); std::fs::rename(&partial, directory.join("s-wait.json")).unwrap();