From 4702c8e06a78c7e4d64263bc77094b764f3c6793 Mon Sep 17 00:00:00 2001 From: Kayshen-X Date: Sat, 25 Jul 2026 13:09:19 +0800 Subject: [PATCH] test(agent): stop cli probe tests racing process startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The hung-CLI probe tests gave the deadline 200ms, which a cold exec of a just-written temp executable can exceed before it prints — the capture came back empty and the auth-marker assert flaked (2 of 3 isolated runs). Give the probes a 2s budget, well past spawn cost, so the timeout branch is reached with the script's output already drained. --- .../src/cli_model_discovery_tests.rs | 15 ++++++++++++--- crates/op-host-services/src/cli_probe_support.rs | 11 +++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/crates/op-host-services/src/cli_model_discovery_tests.rs b/crates/op-host-services/src/cli_model_discovery_tests.rs index c7fce31b3..06857ce0e 100644 --- a/crates/op-host-services/src/cli_model_discovery_tests.rs +++ b/crates/op-host-services/src/cli_model_discovery_tests.rs @@ -132,6 +132,12 @@ fn verified_catalogs_reject_empty_auth_and_unknown_output() { // contract, exercised in `cli_probe_support`'s own test module // (`bounded_cli_output_drains_large_stdout_and_stderr_before_exit`). +/// Probe budget for the hung-CLI tests. Generous relative to spawning a +/// fake CLI (milliseconds) so the timeout branch is reached with the +/// script's output already captured, which is what these tests assert on. +#[cfg(unix)] +const PROBE_BUDGET: Duration = Duration::from_secs(2); + /// Writes an executable `/bin/sh` script standing in for a real CLI so /// `*_models_from_exe` can be pointed at it directly — the discover /// chain's fixed `&["models"]` args rule out the `/bin/sh -c