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 ─────────────────────────────────