From eb147fca4e5ee7e6a0840e64025df077cd9e3ab9 Mon Sep 17 00:00:00 2001 From: thekevinbot <248217931+thekevinbot@users.noreply.github.com> Date: Wed, 2 Sep 2026 13:30:56 -0400 Subject: [PATCH] test(rust): drop the cold-run wall-clock floor from the persist cache test The floor asserted the cold run took at least 3 seconds, which measures the machine rather than the corpus: 4,000 files parse in ~2.2s on a fast box, so `cargo test --workspace --features cli` went red locally while staying green on slower CI runners. The guarantee it stood in for is already carried machine-independently. The parse counters assert the cold run spawned the parser for every file and the warm run for none, which is the cache-reuse claim itself, and the warm/cold ratio bound of 10% is exactly the statement that per-file parsing dominated the cold run. Nothing the floor added survives its removal. --- packages/rust/tests/persist_parsed_path_table.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/rust/tests/persist_parsed_path_table.rs b/packages/rust/tests/persist_parsed_path_table.rs index 71d892d21..3c50dadfa 100644 --- a/packages/rust/tests/persist_parsed_path_table.rs +++ b/packages/rust/tests/persist_parsed_path_table.rs @@ -17,8 +17,8 @@ use std::time::{Duration, Instant, SystemTime}; use tempfile::TempDir; /// Files in the synthetic corpus for the timing test. The parser spawns one -/// process per file, so this is sized to put the cold run comfortably above -/// the 3s floor the ratio assertion needs to mean anything. +/// process per file, so this is sized to make per-file parsing, not the fixed +/// cost of a run, the bulk of the cold run's work. const CORPUS: usize = 4_000; /// The second run must cost no more than this share of the first. @@ -153,11 +153,6 @@ fn unchanged_second_run_reuses_the_cache_instead_of_reparsing() { let (cold_rows, cold) = fx.run(&parser, true); assert_eq!(fx.parses(), CORPUS, "the cold run parses every file once"); assert_eq!(cold_rows.len(), CORPUS); - assert!( - cold >= Duration::from_secs(3), - "the corpus must be big enough for the ratio assertion to mean \ - something; the cold run took {cold:?} — raise CORPUS", - ); let size_before = fx.cache_size(); let digest_before = fx.cache_digest();