From a9c53019a55e1c799b2ad9ae93e7e0d97a332d3e Mon Sep 17 00:00:00 2001 From: ualtinok <94532+ualtinok@users.noreply.github.com> Date: Mon, 23 Nov 2026 19:46:19 +0100 Subject: [PATCH 1/2] Keep PATH in the CLI exit test's environment so it runs on Windows With every variable cleared, AFT on Windows cannot find git, so it never decides whether the test folder is a repository and the meaning-search fill never starts. An early exit now also prints aft's stderr. Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com> --- .../fix-ort-exit-test-windows-path.json | 12 ++++++++++++ crates/aft/tests/integration/cli_ort_exit_test.rs | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 benchmarks/aft-search/slice-descriptors/fix-ort-exit-test-windows-path.json diff --git a/benchmarks/aft-search/slice-descriptors/fix-ort-exit-test-windows-path.json b/benchmarks/aft-search/slice-descriptors/fix-ort-exit-test-windows-path.json new file mode 100644 index 0000000000..9f9187f6a7 --- /dev/null +++ b/benchmarks/aft-search/slice-descriptors/fix-ort-exit-test-windows-path.json @@ -0,0 +1,12 @@ +{ + "slice_class": "non_ranking", + "targeted_mechanism": "none", + "kind": "harness", + "fixtures": [ + "crates/aft/tests/integration/cli_ort_exit_test.rs" + ], + "slices": [ + "fix-ort-exit-test-windows-path" + ], + "note": "Test-only: the CLI exit test keeps PATH (and SystemRoot on Windows) in the child's cleared environment so AFT can find git on Windows, and an early exit now prints aft's stderr. No product code changes." +} diff --git a/crates/aft/tests/integration/cli_ort_exit_test.rs b/crates/aft/tests/integration/cli_ort_exit_test.rs index e5c840b26f..e26974607f 100644 --- a/crates/aft/tests/integration/cli_ort_exit_test.rs +++ b/crates/aft/tests/integration/cli_ort_exit_test.rs @@ -11,11 +11,14 @@ use std::time::{Duration, Instant}; use crate::test_helpers::aft_binary; -fn wait_for_file(path: &Path, child: &mut Child, what: &str) { +fn wait_for_file(path: &Path, child: &mut Child, lines: &mpsc::Receiver, what: &str) { let deadline = Instant::now() + Duration::from_secs(60); while !path.exists() { if let Some(status) = child.try_wait().unwrap() { - panic!("aft exited with {status} before {what}"); + // Give the reader a moment to pass on the last lines aft wrote. + std::thread::sleep(Duration::from_millis(200)); + let stderr: Vec = lines.try_iter().collect(); + panic!("aft exited with {status} before {what}; stderr: {stderr:#?}"); } assert!(Instant::now() < deadline, "timed out waiting for {what}"); std::thread::sleep(Duration::from_millis(10)); @@ -46,6 +49,12 @@ fn warmup_exit_waits_for_a_fill_inside_model_creation() { .arg(&root) .args(["--only", "semantic", "--timeout", "2000"]) .env_clear() + // Keep the search path, and on Windows the system folder: AFT needs + // git to decide whether the root is a repository, and on Windows it + // cannot find git, or run it, without them. The meaning-search fill + // then never starts and the test never reaches the exit it checks. + .env("PATH", std::env::var_os("PATH").unwrap_or_default()) + .envs(std::env::var_os("SystemRoot").map(|value| ("SystemRoot", value))) .env("HOME", &home) .env("USERPROFILE", &home) .env("APPDATA", &home) @@ -73,6 +82,7 @@ fn warmup_exit_waits_for_a_fill_inside_model_creation() { wait_for_file( &hold.join("entered"), &mut child, + &lines_rx, "the fill entered model creation", ); From 43739670ecc229b72a37af04f062bb643ef7e3fb Mon Sep 17 00:00:00 2001 From: ualtinok <94532+ualtinok@users.noreply.github.com> Date: Mon, 23 Nov 2026 19:50:39 +0100 Subject: [PATCH 2/2] Name the search-quality fixture the gate records Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com> --- .../slice-descriptors/fix-ort-exit-test-windows-path.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/aft-search/slice-descriptors/fix-ort-exit-test-windows-path.json b/benchmarks/aft-search/slice-descriptors/fix-ort-exit-test-windows-path.json index 9f9187f6a7..d57ff708b9 100644 --- a/benchmarks/aft-search/slice-descriptors/fix-ort-exit-test-windows-path.json +++ b/benchmarks/aft-search/slice-descriptors/fix-ort-exit-test-windows-path.json @@ -3,7 +3,7 @@ "targeted_mechanism": "none", "kind": "harness", "fixtures": [ - "crates/aft/tests/integration/cli_ort_exit_test.rs" + "harness-goldens" ], "slices": [ "fix-ort-exit-test-windows-path"