Skip to content

Commit

Permalink
Fix race in test_request_during_failover.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajdavis committed Apr 3, 2014
1 parent f6a0686 commit cb101ac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/high_availability/test_ha.py
Expand Up @@ -992,9 +992,10 @@ def test_request_during_failover(self):

# Fail over
ha_tools.kill_primary()
sleep(5)

patience_seconds = 60
for _ in range(patience_seconds):
sleep(1)
try:
if ha_tools.ha_tools_debug:
print 'Waiting for failover'
Expand All @@ -1003,6 +1004,8 @@ def test_request_during_failover(self):
break
except ConnectionFailure:
pass

sleep(1)
else:
self.fail("Problem with test: No new primary after %s seconds"
% patience_seconds)
Expand Down

0 comments on commit cb101ac

Please sign in to comment.