Increase timeout for run_run in ShellCase

This commit is contained in:
Dmitry Kuzmenko 2018-03-21 21:46:19 +03:00
parent 8e60cccdfb
commit 6fdc458a7f
No known key found for this signature in database
GPG key ID: 4C7CAD30C95651DA
2 changed files with 21 additions and 10 deletions

View file

@ -152,8 +152,8 @@ class StateRunnerTest(ShellCase):
' Result: True']
second = [' ID: test-state',
' Function: salt.state',
' Result: True']
' Function: salt.state',
' Result: True']
third = [' ID: cmd.run',
' Function: salt.function',
@ -171,7 +171,7 @@ class StateRunnerTest(ShellCase):
'''
self.run_run('saltutil.sync_runners')
self.run_run('saltutil.sync_wheel')
ret = '\n'.join(self.run_run('state.orchestrate orch.retcode', timeout=120))
ret = '\n'.join(self.run_run('state.orchestrate orch.retcode'))
for result in (' ID: test_runner_success\n'
' Function: salt.runner\n'

View file

@ -139,15 +139,26 @@ class ShellTestCase(TestCase, AdaptedConfigurationTestCaseMixin):
)
return self.run_script('salt-ssh', arg_str, with_retcode=with_retcode, catch_stderr=catch_stderr, raw=True)
def run_run(self, arg_str, with_retcode=False, catch_stderr=False, async=False, timeout=60, config_dir=None):
def run_run(self,
arg_str,
with_retcode=False,
catch_stderr=False,
async=False,
timeout=60,
config_dir=None):
'''
Execute salt-run
'''
arg_str = '-c {0}{async_flag} -t {timeout} {1}'.format(config_dir or self.get_config_dir(),
arg_str,
timeout=timeout,
async_flag=' --async' if async else '')
return self.run_script('salt-run', arg_str, with_retcode=with_retcode, catch_stderr=catch_stderr)
arg_str = '-c {0}{async_flag} -t {timeout} {1}'.format(
config_dir or self.get_config_dir(),
arg_str,
timeout=timeout,
async_flag=' --async' if async else '')
return self.run_script('salt-run',
arg_str,
with_retcode=with_retcode,
catch_stderr=catch_stderr,
timeout=timeout)
def run_run_plus(self, fun, *arg, **kwargs):
'''
@ -483,7 +494,7 @@ class ShellCase(ShellTestCase, AdaptedConfigurationTestCaseMixin, ScriptPathMixi
log.debug('Result of run_ssh for command \'%s\': %s', arg_str, ret)
return ret
def run_run(self, arg_str, with_retcode=False, catch_stderr=False, async=False, timeout=60, config_dir=None):
def run_run(self, arg_str, with_retcode=False, catch_stderr=False, async=False, timeout=180, config_dir=None):
'''
Execute salt-run
'''