fix flaky tool_call_output_exceeds_limit_truncated_chars_limit (#7043)

I am suspecting this is flaky because of the wall time can become 0,
0.1, or 1.
This commit is contained in:
Ahmed Ibrahim
2025-11-20 16:36:29 -08:00
committed by GitHub
parent f56d1dc8fc
commit 1388e99674

View File

@@ -244,11 +244,16 @@ async fn tool_call_output_exceeds_limit_truncated_chars_limit() -> Result<()> {
"expected truncated shell output to be plain text"
);
assert_eq!(output.len(), 9976); // ~10k characters
let truncated_pattern = r#"(?s)^Exit code: 0\nWall time: 0 seconds\nTotal output lines: 100000\nOutput:\n.*?…\d+ chars truncated….*$"#;
let truncated_pattern = r#"(?s)^Exit code: 0\nWall time: [0-9]+(?:\.[0-9]+)? seconds\nTotal output lines: 100000\nOutput:\n.*?…\d+ chars truncated….*$"#;
assert_regex_match(truncated_pattern, &output);
let len = output.len();
assert!(
(9_900..=10_000).contains(&len),
"expected ~10k chars after truncation, got {len}"
);
Ok(())
}