Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion tests/adaptive_scaling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finding 1 (blocking): scaler: None here makes decide_with_brain take the no-scaler else branch (src/ooda_loop/decide.rs:44-45), so the scaler-override path (decide.rs:42-43) this test is named for is never exercised — the test now duplicates decide_respects_max_concurrent_actions. The finalized decision was Option A: scaler: Some(Arc::new(AdaptiveScaler::new(2, 2, 2))) and remove ..OodaConfig::default(), which keeps it hermetic and actually exercises override. Either adopt Option A, or rename the test (e.g. config_max_concurrent_actions_respected_when_no_scaler) so the name isn't misleading. Verified: pre-fix panics got 5 actions under SIMARD_SCALING=auto; this fix passes.

..OodaConfig::default()
};

Expand Down
Loading