fix(ecstore): guard transition worker max (#3003)

* fix(ecstore): guard transition worker max

* test: clarify env mutation safety

* test(ecstore): document env mutation concurrency contract
This commit is contained in:
安正超
2026-05-19 10:25:51 +08:00
committed by GitHub
parent a66337bd28
commit e65aebba53
3 changed files with 49 additions and 2 deletions
@@ -327,6 +327,9 @@ async fn wait_for_transition(
}
}
// SAFETY: this helper is used only by `#[serial]` tests and runs under the single-threaded Tokio
// runtime (`worker_threads = 1`), so no concurrent test can mutate process environment during the
// `env::set_var` / `env::remove_var` window.
#[allow(unsafe_code)]
async fn with_forced_immediate_enqueue_timeout<F, Fut>(test_fn: F)
where