diff --git a/ansible_runner/runner.py b/ansible_runner/runner.py index 737d557fd..a0289ac20 100644 --- a/ansible_runner/runner.py +++ b/ansible_runner/runner.py @@ -35,6 +35,7 @@ def __init__(self, config, cancel_callback=None, remove_partials=True, event_han self.status_handler = status_handler self.canceled = False self.timed_out = False + self.idle_timed_out = False self.errored = False self.status = "unstarted" self.rc = None @@ -337,7 +338,7 @@ def _decode(x): if self.config.idle_timeout and (time.time() - self.last_stdout_update) > self.config.idle_timeout: self.kill_container() Runner.handle_termination(child.pid, is_cancel=False) - self.timed_out = True + self.idle_timed_out = True stdout_handle.close() stderr_handle.close() @@ -350,6 +351,8 @@ def _decode(x): self.status_callback('successful') elif self.timed_out: self.status_callback('timeout') + elif self.idle_timed_out: + self.status_callback('idle_timeout') else: self.status_callback('failed') diff --git a/test/integration/test_runner.py b/test/integration/test_runner.py index c3ccfa656..cff7183dd 100644 --- a/test/integration/test_runner.py +++ b/test/integration/test_runner.py @@ -110,7 +110,7 @@ def test_run_command_idle_timeout(rc): rc.idle_timeout = 0.0000001 runner = Runner(config=rc) status, exitcode = runner.run() - assert status == 'timeout' + assert status == 'idle_timeout' assert exitcode == 254