Skip to content

Commit 40e6dcf

Browse files
ualtinokalfonso-aft
andcommitted
test: calibrate the ast_search perf tripwire for slow CI hardware
Same calibration as its ast_replace twin from this morning: the 5s bound was written for dev machines, and a contended 2-core Windows CI runner exceeded it on the healthy path (guarded failure modes sit past 30s, so 20s still trips them with wide margin). The twin was widened this morning; this is the ast_search copy 40 lines above it that the same runner then found. Co-authored-by: Alfonso <289616620+alfonso-aft@users.noreply.github.com>
1 parent ad7605c commit 40e6dcf

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/aft/tests/integration/ast_commands_test.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,9 +1349,15 @@ fn ast_search_member_access_pattern_completes_in_reasonable_time() {
13491349
// Each file has 1 occurrence of the field-access pattern.
13501350
assert_eq!(resp["total_matches"], 60);
13511351

1352+
// Regression tripwire, not a benchmark: the guarded failure modes
1353+
// (re-compiling the pattern per file, losing the rayon par_iter walk)
1354+
// push 60 files well past 30s. The bound only needs to sit far below
1355+
// that while tolerating slow hardware — a contended 2-core Windows CI
1356+
// runner exceeded 5s on the healthy path where dev machines take well
1357+
// under 2s (same calibration as the ast_replace twin below).
13521358
assert!(
1353-
elapsed.as_secs_f64() < 5.0,
1354-
"ast_search regressed: {} files took {:.2}s (expected < 5s). \
1359+
elapsed.as_secs_f64() < 20.0,
1360+
"ast_search regressed: {} files took {:.2}s (expected < 20s). \
13551361
If this fails, check that ast_search.rs still pre-compiles the pattern \
13561362
outside the file loop and uses rayon par_iter for the file walk.",
13571363
resp["files_searched"],

0 commit comments

Comments
 (0)