Skip to content

Commit 8b7daaa

Browse files
committed
ca†ch 503 before parsing json
1 parent 161bf22 commit 8b7daaa

File tree

1 file changed

+4
-6
lines changed
  • examples/server/tests/features/steps

1 file changed

+4
-6
lines changed

examples/server/tests/features/steps/steps.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,14 +1208,12 @@ async def wait_for_slots_status(context,
12081208
while True:
12091209
async with await session.get(f'{base_url}/slots', params=params) as slots_response:
12101210
status_code = slots_response.status
1211-
try:
1212-
slots = await slots_response.json()
1213-
except:
1214-
slots = await slots_response.text()
1215-
if context.debug:
1216-
print(f"slots responses {slots}\n")
12171211
if status_code == 503 and status_code == expected_http_status_code:
12181212
return
1213+
slots = await slots_response.json()
1214+
if context.debug:
1215+
print(f"slots responses {slots}\n")
1216+
12191217
if status_code == 200 and status_code == expected_http_status_code:
12201218
n_slots_idle = sum(1 if slot["state"] == 0 else 0 for slot in slots)
12211219
n_slots_processing = sum(1 if slot["state"] != 0 else 0 for slot in slots)

0 commit comments

Comments
 (0)