kvm resiliency test: better handling when takeover fails.

parent fecbf6f4
...@@ -163,6 +163,8 @@ def runTestSuite(server_url, key_file, cert_file, ...@@ -163,6 +163,8 @@ def runTestSuite(server_url, key_file, cert_file,
# Make the clone instance takeover the main instance # Make the clone instance takeover the main instance
logger.info('Replacing main instance by clone instance...') logger.info('Replacing main instance by clone instance...')
for i in range(0, 10):
try:
takeover( takeover(
server_url=server_url, server_url=server_url,
key_file=key_file, key_file=key_file,
...@@ -173,6 +175,13 @@ def runTestSuite(server_url, key_file, cert_file, ...@@ -173,6 +175,13 @@ def runTestSuite(server_url, key_file, cert_file,
namebase=namebase, namebase=namebase,
winner_instance_suffix=str(current_clone), winner_instance_suffix=str(current_clone),
) )
break
except: # SSLError
traceback.print_exc()
if i is 9:
raise
logger.warning('takeover failed. Retrying...')
time.sleep(10)
logger.info('Done.') logger.info('Done.')
# Wait for the new IP (of old-clone new-main instance) to appear. # Wait for the new IP (of old-clone new-main instance) to appear.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment