Skip to content

Commit 238766d

Browse files
committed
Refactor test_conference_recordings to implement retry logic for recording availability
1 parent 87e1f5a commit 238766d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

test/smoke/test_conferences_api.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,15 @@ def test_conference_recordings(self) -> None:
270270
BW_ACCOUNT_ID, conference_id, updateBxmlBody)
271271
assert_that(update_conference_bxml_response.status_code, 204)
272272

273-
# Sleep 30 seconds to ensure recording exists
274-
time.sleep(30)
275-
276-
list_conference_recordings_response: ApiResponse = self.conference_api_instance.list_conference_recordings_with_http_info(
277-
BW_ACCOUNT_ID, conference_id)
278-
assert_that(list_conference_recordings_response.status_code, 200)
273+
max_attempts = 5
274+
for _ in range(max_attempts):
275+
list_conference_recordings_response: ApiResponse = self.conference_api_instance.list_conference_recordings_with_http_info(
276+
BW_ACCOUNT_ID, conference_id)
277+
if list_conference_recordings_response.status_code == 200:
278+
break
279+
time.sleep(self.TEST_SLEEP_LONG)
280+
else:
281+
raise AssertionError(f"Conference recordings not available. Response:{list_conference_recordings_response.data}")
279282

280283
conference_recordings = list_conference_recordings_response.data
281284
assert_that(len(conference_recordings), greater_than(0))

0 commit comments

Comments
 (0)