Merge pull request #47846 from Ch3LL/p_refresh_test

Fix flaky refresh pillar integration test
This commit is contained in:
Nicole Thomas 2018-05-25 16:50:48 -04:00 committed by GitHub
commit 0bf651b470
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -188,7 +188,18 @@ class SaltUtilSyncPillarTest(ModuleCase):
'''))
pillar_refresh = self.run_function('saltutil.refresh_pillar')
wait = self.run_function('test.sleep', [5])
pillar = False
timeout = time.time() + 30
while not pillar:
post_pillar = self.run_function('pillar.raw')
try:
self.assertIn(pillar_key, post_pillar.get(pillar_key, 'didnotwork'))
pillar = True
except AssertionError:
if time.time() > timeout:
self.assertIn(pillar_key, post_pillar.get(pillar_key, 'didnotwork'))
continue
post_pillar = self.run_function('pillar.raw')
self.assertIn(pillar_key, post_pillar.get(pillar_key, 'didnotwork'))