Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion sgl-router/py_test/integration_mock/test_circuit_breaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,21 @@ def post_once():
timeout=3,
)

saw_503 = False
# should see 500 when worker actually starts, before that should see 503
saw_500 = False
for _ in range(8):
r = post_once()
if r.status_code == 500:
# Worker starts, continue to circuit breaker test
saw_500 = True
break
assert (
r.status_code == 503
), "Should only see 503 when waiting for worker to start"
assert saw_500, "Worker didn't start after 8 requests"

saw_503 = False
for _ in range(4):
r = post_once()
if r.status_code == 503:
saw_503 = True
Expand Down
Loading