mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
re-fixed simultaneous GCE tests
This commit is contained in:
parent
326e9f23dd
commit
4fc5e9e44d
1 changed files with 7 additions and 3 deletions
|
@ -97,11 +97,11 @@ class CloudTest(ShellCase):
|
|||
log.debug('Instance exists and was created: "{}"'.format(instance_name))
|
||||
|
||||
def _destroy_instance(self):
|
||||
shutdown_delay = 30
|
||||
log.debug('Deleting instance "{}"'.format(self.instance_name))
|
||||
delete = self.run_cloud('-d {0} --assume-yes'.format(self.instance_name), timeout=TIMEOUT)
|
||||
# example response: ['gce-config:', '----------', ' gce:', '----------', 'cloud-test-dq4e6c:', 'True', '']
|
||||
delete_str = ''.join(delete)
|
||||
destroyed = False
|
||||
log.debug('Deletion status: {}'.format(delete_str))
|
||||
|
||||
if any([x in delete_str for x in (
|
||||
|
@ -114,11 +114,15 @@ class CloudTest(ShellCase):
|
|||
'shutting-down',
|
||||
'.delete',
|
||||
)]):
|
||||
sleep(shutdown_delay)
|
||||
destroyed = True
|
||||
log.debug('Instance "{}" is cleaning up'.format(self.instance_name))
|
||||
sleep(30)
|
||||
else:
|
||||
log.warning('Instance "{}" may not have been deleted properly'.format(self.instance_name))
|
||||
sleep(shutdown_delay)
|
||||
# It's not clear from the delete string that deletion was successful, ask salt-cloud
|
||||
query = self.query_instances()
|
||||
destroyed = self.instance_name in query
|
||||
delete_str += ' :: ' * bool(delete_str) + ', '.join(query)
|
||||
|
||||
return destroyed, delete_str
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue