Skip to content

Commit eb6cc52

Browse files
committed
Fix flaky test
1 parent 5932dbf commit eb6cc52

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/unit/test_resilience.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ def test_reopens_on_failure_in_half_open(self):
253253
time.sleep(0.02)
254254
assert cb.state == CircuitState.HALF_OPEN
255255

256+
# Use a longer timeout before recording failure so circuit stays OPEN
257+
# long enough to assert (the short 10ms timeout causes race conditions)
258+
cb._config = CircuitBreakerConfig(failure_threshold=1, timeout_seconds=10.0)
256259
cb.record_failure()
257260
assert cb.state == CircuitState.OPEN
258261

0 commit comments

Comments
 (0)