Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit ca1a71e

Browse files
committed
Retry replication stop test on HTTP 409 response status code
1 parent cb6998c commit ca1a71e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/unit/replicator_tests.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,16 @@ def test_stop_replication(self):
356356
self.target_db,
357357
repl_id
358358
)
359-
self.replicator.stop_replication(repl_id)
359+
max_retry = 3
360+
while True:
361+
try:
362+
max_retry -= 1
363+
self.replicator.stop_replication(repl_id)
364+
break
365+
except requests.HTTPError as err:
366+
self.assertEqual(err.response.status_code, 409)
367+
if max_retry == 0:
368+
self.fail('Failed to stop replication: {0}'.format(err))
360369
try:
361370
# The .fetch() will fail since the replication has been stopped
362371
# and the replication document has been removed from the db.

0 commit comments

Comments
 (0)