test: one fallback suite on one in-process vendor - #89
Merged
Merged
Conversation
#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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#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 inhandler/src/lib.rsthat ran their own TCP vendor (vendor_by_model+fallback_handler).This folds all eight tests into
crates/handler/tests/fallback.rs, on the in-processVendorstub and config fixture from #86:brokenfails upstream, its chain targetthrottledis 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 athealthy)Vendor::calls()replaces the repeatedvendor.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: cleancargo clippy --workspace --all-targets -- -D warnings: cleancargo test --workspace: 617 passed, 0 failed (PG/Redis env-gated suites not run)swap_to_fallbackreverted to the pre-fix: preserve requested model through quota fallback #88 unconditional write, the regression fails in each arm — the served arm echoesthrottledinstead ofbroken, and the failing arm ends in a 503 because the chain continues fromthrottled's empty list