Skip to content

Commit

Permalink
Less flaky mine tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz committed Apr 30, 2019
1 parent cca7138 commit 843188f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/integration/modules/test_mine.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ def test_mine_flush(self):
'''
Test mine.flush
'''
# TODO The calls to sleep were added in an attempt to make this tests
# less flaky. If we still see it fail we need to look for a more robust
# solution.
for minion_id in ('minion', 'sub_minion'):
self.assertTrue(
self.run_function(
Expand All @@ -80,20 +83,22 @@ def test_mine_flush(self):
minion_tgt=minion_id
)
)
time.sleep(1)
time.sleep(1)
for minion_id in ('minion', 'sub_minion'):
ret = self.run_function(
'mine.get',
[minion_id, 'grains.items'],
minion_tgt=minion_id
)
self.assertEqual(ret[minion_id]['id'], minion_id)
time.sleep(1)
self.assertTrue(
self.run_function(
'mine.flush',
minion_tgt='minion'
)
)
time.sleep(1)
ret_flushed = self.run_function(
'mine.get',
['*', 'grains.items']
Expand All @@ -105,12 +110,16 @@ def test_mine_delete(self):
'''
Test mine.delete
'''
# TODO The calls to sleep were added in an attempt to make this tests
# less flaky. If we still see it fail we need to look for a more robust
# solution.
self.assertTrue(
self.run_function(
'mine.send',
['grains.items']
)
)
time.sleep(1)
# Smoke testing that grains should now exist in the mine
ret_grains = self.run_function(
'mine.get',
Expand All @@ -123,6 +132,7 @@ def test_mine_delete(self):
['test.arg', 'foo=bar', 'fnord=roscivs'],
)
)
time.sleep(1)
ret_args = self.run_function(
'mine.get',
['minion', 'test.arg']
Expand All @@ -144,6 +154,7 @@ def test_mine_delete(self):
['test.echo', 'foo']
)
)
time.sleep(1)
ret_echo = self.run_function(
'mine.get',
['minion', 'test.echo']
Expand All @@ -156,6 +167,7 @@ def test_mine_delete(self):
['test.arg']
)
)
time.sleep(1)
ret_arg_deleted = self.run_function(
'mine.get',
['minion', 'test.arg']
Expand Down

0 comments on commit 843188f

Please sign in to comment.