test(resilience): characterize Brainarr circuit breaker behavior#371
Merged
RicherTunes merged 1 commit intomainfrom Jan 16, 2026
Merged
test(resilience): characterize Brainarr circuit breaker behavior#371RicherTunes merged 1 commit intomainfrom
RicherTunes merged 1 commit intomainfrom
Conversation
e70f250 to
c3bbd26
Compare
Add 25 characterization tests documenting current circuit breaker semantics
for WS4.2 migration decision-making:
- Keying scheme: "ai:{provider}:{modelId}" format
- Failure classification: TaskCanceledException/TimeoutException/HttpRequestException
as failures; 4xx client errors excluded via brittle string matching
- Dual-trip logic: consecutive failures (≥5) OR failure rate (≥50% with ≥10 ops)
- Half-open transitions: 3 successes to close, any failure re-opens
- Minimum throughput guard: rate-based opening requires ≥10 operations
- Windowing: CircularBuffer sliding window behavior
- Configuration constants: documents BrainarrConstants defaults
Key findings for WS4.2:
- CRITICAL: TaskCanceledException treated as failure (may trip during shutdown)
- IMPORTANT: 4xx detection via string matching ("4" + "Bad Request") is brittle
- Dual-trip + minimum throughput must map to Common
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
c3bbd26 to
99d226b
Compare
3 tasks
RicherTunes
added a commit
that referenced
this pull request
Feb 17, 2026
Picks up: - #383: fix(ci): Windows credential issue in change detection step - #367: deps: coverlet.collector 6.0.4 → 8.0.0 - #370: deps: publicapigenerator.tool 11.4.6 → 11.5.4 - #371: deps: Spectre.Console 0.50.0 → 0.54.0 - #375: deps: xunit 2.9.2 → 2.9.3 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 tasks
RicherTunes
added a commit
that referenced
this pull request
Feb 17, 2026
Picks up: - #383: fix(ci): Windows credential issue in change detection step - #367: deps: coverlet.collector 6.0.4 → 8.0.0 - #370: deps: publicapigenerator.tool 11.4.6 → 11.5.4 - #371: deps: Spectre.Console 0.50.0 → 0.54.0 - #375: deps: xunit 2.9.2 → 2.9.3 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
RicherTunes
added a commit
that referenced
this pull request
Feb 17, 2026
Picks up: - #383: fix(ci): Windows credential issue in change detection step - #367: deps: coverlet.collector 6.0.4 → 8.0.0 - #370: deps: publicapigenerator.tool 11.4.6 → 11.5.4 - #371: deps: Spectre.Console 0.50.0 → 0.54.0 - #375: deps: xunit 2.9.2 → 2.9.3 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Add 26 characterization tests documenting current circuit breaker semantics for WS4.2 migration decision-making.
Test Coverage by Category
Keying Scheme (2 tests)
"ai:{provider}:{modelId}"format from BreakerRegistryFailure Classification (4 tests)
TaskCanceledException→ failureTimeoutException→ failureHttpRequestException→ failureDual-Trip Logic (2 tests)
Half-Open Transitions (3 tests)
Minimum Throughput Guard (1 test)
Windowing (2 tests)
Configuration Constants (3 tests)
Key Findings for WS4.2
TaskCanceledExceptiontreated as failure - can trip breaker during host shutdown, request aborts, or client timeoutsex.Message.Contains("4") && ex.Message.Contains("Bad Request")is brittle and locale-dependentWS4.2 Migration Path
These tests become the contract that WS4.2 must satisfy:
Test Plan
🤖 Generated with Claude Code