From fe0077f64bb247769366d2d5224733c84e4dc443 Mon Sep 17 00:00:00 2001 From: rysweet Date: Fri, 24 Jul 2026 11:25:52 +0000 Subject: [PATCH] test: make scaler_current_max_can_override_config hermetic The integration test built its OodaConfig with ..OodaConfig::default(), which reads SIMARD_SCALING from the process env. On a host with SIMARD_SCALING=auto the env-seeded AIMD scaler overrode the explicit max_concurrent_actions, so decide() returned the scaler's adjusted limit (5) instead of the intended cap (2) and the test failed deterministically. Force scaler: None so the numeric current_max is the sole cap, matching the fix issue #2732 applied to the sibling unit test decide_respects_max_concurrent_actions (this integration test was missed by that pass). No production behavior change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/adaptive_scaling.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/adaptive_scaling.rs b/tests/adaptive_scaling.rs index d3aa38961..7b92b2eb2 100644 --- a/tests/adaptive_scaling.rs +++ b/tests/adaptive_scaling.rs @@ -312,9 +312,18 @@ fn scaler_current_max_can_override_config() { }) .collect(); - // Use scaler's current_max as the config limit. + // Use scaler's current_max as the config limit. `scaler: None` is explicit + // (not left to `..OodaConfig::default()`): `OodaConfig::default()` reads + // `SIMARD_SCALING` from the process env, so on a host with + // `SIMARD_SCALING=auto` the env-seeded AIMD scaler would override the + // explicit `max_concurrent_actions` under test and the result would depend + // on the environment rather than the config. Forcing `scaler: None` keeps + // the test hermetic — the numeric `current_max` is the sole cap (issue + // #2732 fixed the sibling `decide_respects_max_concurrent_actions` the same + // way; this integration test was missed by that pass). let config = OodaConfig { max_concurrent_actions: scaler.current_max(), + scaler: None, ..OodaConfig::default() };