Increase cli batch test timeout for increased reliablity

This commit is contained in:
Daniel A. Wozniak 2018-11-02 12:46:38 -07:00
parent 99c8f356eb
commit 18b5d43d09
No known key found for this signature in database
GPG key ID: 166B9D2C06C82D61

View file

@ -5,6 +5,8 @@
# Import Python libs
from __future__ import absolute_import
import salt.utils
# Import Salt Testing Libs
from tests.support.case import ShellCase
@ -13,13 +15,20 @@ class BatchTest(ShellCase):
'''
Integration tests for the salt.cli.batch module
'''
if salt.utils.is_windows():
run_timeout = 90
else:
run_timeout = 30
def test_batch_run(self):
'''
Tests executing a simple batch command to help catch regressions
'''
ret = 'Executing run on [\'sub_minion\']'
cmd = self.run_salt('"*minion" test.echo "batch testing" -b 50%')
cmd = self.run_salt(
'"*minion" test.echo "batch testing" -b 50%',
timeout=self.run_timeout,
)
self.assertIn(ret, cmd)
def test_batch_run_number(self):
@ -28,7 +37,10 @@ class BatchTest(ShellCase):
a percentage with full batch CLI call.
'''
ret = "Executing run on ['minion', 'sub_minion']"
cmd = self.run_salt('"*minion" test.ping --batch-size 2')
cmd = self.run_salt(
'"*minion" test.ping --batch-size 2',
timeout=self.run_timeout,
)
self.assertIn(ret, cmd)
def test_batch_run_grains_targeting(self):
@ -45,7 +57,10 @@ class BatchTest(ShellCase):
os_grain = item
os_grain = os_grain.strip()
cmd = self.run_salt('-C "G@os:{0} and not localhost" -b 25% test.ping'.format(os_grain))
cmd = self.run_salt(
'-C "G@os:{0} and not localhost" -b 25% test.ping'.format(os_grain),
timeout=self.run_timeout,
)
self.assertIn(sub_min_ret, cmd)
self.assertIn(min_ret, cmd)
@ -53,5 +68,9 @@ class BatchTest(ShellCase):
'''
Test that a failed state returns a non-zero exit code in batch mode
'''
cmd = self.run_salt(' "*" state.single test.fail_without_changes name=test_me -b 25%', with_retcode=True)
cmd = self.run_salt(
' "*" state.single test.fail_without_changes name=test_me -b 25%',
with_retcode=True,
timeout=self.run_timeout,
)
self.assertEqual(cmd[-1], 2)