From 0c8cf66d55e762ef31fc879e85a2528e446e9900 Mon Sep 17 00:00:00 2001 From: Natalie Date: Tue, 30 Jun 2026 08:45:34 -0400 Subject: [PATCH] test(mc-mapgen): relax flaky wall-clock guard in test_map_gen_standard_speed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 500ms bound had negative headroom on the DO test fleet (s-8vcpu-16gb): standard mapgen runs ~465-608ms there and drifts higher under the full parallel test pool, so the test flaked (passed isolated, failed in the 2923-test workspace run). Relaxed to a generous 2500ms order-of-magnitude regression guard — still catches a real (O(n^2)-class, seconds) regression without flaking on host/CI load. Verified 5/5 green on the fleet. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/simulator/crates/mc-mapgen/src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/simulator/crates/mc-mapgen/src/lib.rs b/src/simulator/crates/mc-mapgen/src/lib.rs index 7712b119..42db7144 100644 --- a/src/simulator/crates/mc-mapgen/src/lib.rs +++ b/src/simulator/crates/mc-mapgen/src/lib.rs @@ -1290,13 +1290,18 @@ mod tests { #[test] fn test_map_gen_standard_speed() { - // Standard map must complete in reasonable time (performance regression guard). + // Coarse order-of-magnitude regression guard. The bound is deliberately + // generous: on the DO test fleet (s-8vcpu-16gb) standard mapgen runs + // ~465-608ms, and under the full parallel test pool it drifts higher, so + // a tight 500ms wall-clock assertion flaked (negative headroom). A real + // regression here would be an accidental O(n^2) — seconds, not ms — which + // 2500ms still catches without flaking on host/CI load variance. let gen = MapGenerator::new("{}"); let start = std::time::Instant::now(); let grid = gen.generate(999, "standard"); let elapsed = start.elapsed(); assert_eq!(grid.tiles.len(), (80 * 52) as usize); - assert!(elapsed.as_millis() < 500, "standard map gen took {}ms — too slow", elapsed.as_millis()); + assert!(elapsed.as_millis() < 2500, "standard map gen took {}ms — too slow", elapsed.as_millis()); } // ── guarantee_iron_ore_near_starts tests ─────────────────────────────────