Skip to content

test: one fallback suite on one in-process vendor - #89

Merged
CMGS merged 1 commit into
mainfrom
test/fallback-suite
Sep 18, 2026
Merged

CMGS merged 1 commit into
mainfrom
test/fallback-suite

Conversation

@CMGS

@CMGS CMGS commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

#86 and #88 each added a crates/handler/tests/ file on model fallback (fallback_admission.rs, fallback_origin.rs), with two different transports, beside four inline fallback tests in handler/src/lib.rs that ran their own TCP vendor (vendor_by_model + fallback_handler).

This folds all eight tests into crates/handler/tests/fallback.rs, on the in-process Vendor stub and config fixture from #86:

  • the four inline tests move over with their assertions unchanged; the TCP fixture goes
  • the fix: preserve requested model through quota fallback #88 regression runs on the shared models: broken fails upstream, its chain target throttled is over its per-model quota and degrades to the tenant fallback, which either serves (healthy) or has no account (unavailable, so the original chain resumes at healthy)
  • Vendor::calls() replaces the repeated vendor.0.load(Ordering::Relaxed)

Production code is untouched. Test count is unchanged (99 in gw-handler); tests are −77 lines and one test binary instead of two.

Validation:

  • cargo fmt --all --check: clean
  • cargo clippy --workspace --all-targets -- -D warnings: clean
  • cargo test --workspace: 617 passed, 0 failed (PG/Redis env-gated suites not run)
  • mutation: with swap_to_fallback reverted to the pre-fix: preserve requested model through quota fallback #88 unconditional write, the regression fails in each arm — the served arm echoes throttled instead of broken, and the failing arm ends in a 503 because the chain continues from throttled's empty list

#86 and #88 each added a handler integration file on model fallback, next to
four inline fallback tests that ran their own TCP vendor. Fold all eight into
tests/fallback.rs on the #86 stub and config fixture: one test binary, one
fixture, no socket server. The #88 regression keeps both arms (tenant fallback
serves; tenant fallback fails and the original chain resumes) on the shared
models, and still fails against the pre-fix swap_to_fallback in each arm.
@CMGS
CMGS merged commit 2d6682a into main Sep 18, 2026
2 checks passed
@CMGS
CMGS deleted the test/fallback-suite branch September 18, 2026 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant