mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Try harder to get the minion grains
This commit is contained in:
parent
36717bddd7
commit
a0346d18bf
@ -126,18 +126,34 @@ class MineTest(ModuleCase):
|
||||
)
|
||||
)
|
||||
self.wait_for_all_jobs(minions=('minion',))
|
||||
# Smoke testing that grains should now exist in the mine
|
||||
ret_grains = self.run_function(
|
||||
'mine.get',
|
||||
['minion', 'grains.items'],
|
||||
minion_tgt='minion'
|
||||
)
|
||||
if 'minion' not in ret_grains:
|
||||
|
||||
attempts = 10
|
||||
ret_grains = None
|
||||
while True:
|
||||
if ret_grains:
|
||||
break
|
||||
# Smoke testing that grains should now exist in the mine
|
||||
ret_grains = self.run_function(
|
||||
'mine.get',
|
||||
['minion', 'grains.items'],
|
||||
minion_tgt='minion'
|
||||
)
|
||||
if ret_grains and 'minion' in ret_grains:
|
||||
break
|
||||
|
||||
if attempts:
|
||||
attempts -= 1
|
||||
|
||||
if attempts:
|
||||
time.sleep(1.5)
|
||||
continue
|
||||
|
||||
self.fail(
|
||||
'\'minion\' was not found as a key of the \'mine.get\' \'grains.items\' call. Full return: {}'.format(
|
||||
pprint.pformat(ret_grains)
|
||||
)
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
ret_grains['minion']['id'], 'minion',
|
||||
msg='{} != minion, full return payload: {}'.format(
|
||||
|
Loading…
Reference in New Issue
Block a user