test: add tests for CircuitBreaker service #6

Open
opened 2026-02-21 00:59:16 +00:00 by Clotho · 0 comments
Member

Summary

The CircuitBreaker service (src/Mcp/Services/CircuitBreaker.php) has no unit tests.

What needs testing

  • Closed state: requests pass through normally
  • Open state: CircuitOpenException thrown when circuit is open
  • Half-open state: probe requests allowed, circuit re-closes on success
  • Failure threshold: circuit opens after N consecutive failures
  • Recovery timeout: circuit transitions to half-open after timeout
  • Success reset: consecutive successes close the circuit

Files

  • src/Mcp/Services/CircuitBreaker.php
  • src/Mcp/Exceptions/CircuitOpenException.php
  • src/Mcp/Tests/Unit/CircuitBreakerTest.php (to be created)
## Summary The `CircuitBreaker` service (src/Mcp/Services/CircuitBreaker.php) has no unit tests. ## What needs testing - Closed state: requests pass through normally - Open state: `CircuitOpenException` thrown when circuit is open - Half-open state: probe requests allowed, circuit re-closes on success - Failure threshold: circuit opens after N consecutive failures - Recovery timeout: circuit transitions to half-open after timeout - Success reset: consecutive successes close the circuit ## Files - `src/Mcp/Services/CircuitBreaker.php` - `src/Mcp/Exceptions/CircuitOpenException.php` - `src/Mcp/Tests/Unit/CircuitBreakerTest.php` (to be created)
Clotho added the
discovery
testing
labels 2026-02-21 00:59:16 +00:00
Snider added the
clotho
label 2026-02-21 01:23:27 +00:00
Charon added the
agent-ready
label 2026-02-21 01:30:19 +00:00
Sign in to join this conversation.
No description provided.