Skip to content

Commit cdb045f

Browse files
committed
sdk/python: deflake copy tests with assert_with_retries
Signed-off-by: Ryan Koo <rbk65@cornell.edu>
1 parent f3634bb commit cdb045f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

python/tests/integration/sdk/test_object_group_ops.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,10 @@ def _copy_objects_test_helper(self, num_workers=None):
192192
)
193193
for job_id in copy_job_ids:
194194
self.client.job(job_id=job_id).wait_for_idle(timeout=TEST_TIMEOUT * 2)
195-
196-
self.assertEqual(
197-
4, len(to_bck.list_all_objects(prefix=new_prefix + self.obj_prefix))
195+
assert_with_retries(
196+
self.assertEqual,
197+
4,
198+
len(to_bck.list_all_objects(prefix=new_prefix + self.obj_prefix)),
198199
)
199200

200201
def test_copy_objects(self):
@@ -344,7 +345,7 @@ def _copy_and_check_with_latest(
344345
)
345346
for job_id in copy_job_ids:
346347
self.client.job(job_id=job_id).wait_for_idle(timeout=TEST_TIMEOUT * 2)
347-
self.assertEqual(1, len(to_bck.list_all_objects()))
348+
assert_with_retries(self.assertEqual, 1, len(to_bck.list_all_objects()))
348349
content = to_bck.object(obj_name).get_reader().read_all()
349350
self.assertEqual(expected, content.decode("utf-8"))
350351

0 commit comments

Comments
 (0)