omnigraph/crates/omnigraph-server
Ragnor Comerford 3ad359db8b
tests: admission test uses new_with_workload, drops env mutation + #[serial]
Migrates `ingest_per_actor_admission_cap_returns_429` from env-var
override to direct `WorkloadController::new(1, ...)` construction via
`AppState::new_with_workload`. Removes the `EnvGuard` and the
`#[serial]` annotation that paired with it.

Why correct by design (AGENTS.md rule 9): the previous round's matrix
fix (commit 8bd9a5f) shielded the matrix from this test's env
mutation, but the broader bug class — "test A's process-wide env
mutation can leak into any test B that calls
`AppState::open` / `WorkloadController::from_env()`" — was still
reachable by any future test that didn't think to opt out. Closing
the class at the source: this test no longer mutates global state at
all, so no other test needs to defend against it.

Net effect:
- This test no longer needs `#[serial]` (was the only reason it was
  marked) — runs in parallel with the rest of the suite.
- The matrix's defensive `with_defaults()` construction (commit
  8bd9a5f) remains correct but is no longer required for correctness;
  it's now a "belt and suspenders" guard against any FUTURE
  env-mutating test.

Verified locally: both tests pass when run together; full server
suite (44 tests) green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 20:35:41 +02:00
..
examples bench: assert --heavy-concurrency > 0 instead of silently clamping 2026-05-08 19:23:02 +02:00
src server+bench: AppState::new_with_workload; bench drops set_var, exercises heavy cap 2026-05-08 17:57:42 +02:00
tests tests: admission test uses new_with_workload, drops env mutation + #[serial] 2026-05-08 20:35:41 +02:00
Cargo.toml server: add WorkloadController for per-actor admission (PR 2 Step E) 2026-05-07 16:59:45 +02:00