From 0777de1b1fcc59a8d35686c90ed1aaccac824222 Mon Sep 17 00:00:00 2001 From: Mykhailo Chalyi Date: Fri, 6 Nov 2026 04:28:20 +0000 Subject: [PATCH] test(rg): warm up rg before measuring its bounded-memory walk The first rg in the process builds one-time state, which the first measured command was charged for: 5.2 MiB locally when this test ran first in the binary, 8.5 MiB on CI against the 8 MiB bound. Run rg once on a small subtree before measuring; the walk itself peaks at 1.3 MiB. --- crates/bashkit/tests/large_tree_stress_tests.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/bashkit/tests/large_tree_stress_tests.rs b/crates/bashkit/tests/large_tree_stress_tests.rs index 7dd046f0e..226dfcdb6 100644 --- a/crates/bashkit/tests/large_tree_stress_tests.rs +++ b/crates/bashkit/tests/large_tree_stress_tests.rs @@ -425,6 +425,12 @@ async fn rg_stops_at_the_input_budget_on_a_huge_tree() { async fn rg_within_budget_holds_bounded_memory() { let _serial = SERIAL.lock().await; let (fs, mut bash) = setup().await; + // The first rg in the process builds one-time state (4 MiB locally, more + // on CI, where it pushed this past BOUNDED_PEAK). It is not per-file + // memory, so pay it on a small subtree first and measure only the walk. + bash.exec("rg -l nomatch /big/d0 > /dev/null") + .await + .unwrap(); for cmd in [ "rg -l nomatch /big", "rg -c nomatch /big/d1 /big/d0",