Skip to content

Commit

Permalink
Merge pull request #5709 from dgibson/simplify-timeout
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Richter <[email protected]>
  • Loading branch information
richtja committed Jun 26, 2023
2 parents 9fbd267 + 9a09ef8 commit 7c10487
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions avocado/plugins/runners/avocado_instrumented.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,13 @@ def run(self, runnable):
time_started = time.monotonic()

timeout = float(self.DEFAULT_TIMEOUT)
most_current_execution_state_time = None
next_status_time = None
while True:
time.sleep(RUNNER_RUN_CHECK_INTERVAL)
now = time.monotonic()
if queue.empty():
if most_current_execution_state_time is not None:
next_execution_state_mark = (
most_current_execution_state_time
+ RUNNER_RUN_STATUS_INTERVAL
)
if (
most_current_execution_state_time is None
or now > next_execution_state_mark
):
most_current_execution_state_time = now
if next_status_time is None or now > next_status_time:
next_status_time = now + RUNNER_RUN_STATUS_INTERVAL
yield messages.RunningMessage.get()
if (now - time_started) > timeout:
process.terminate()
Expand Down

0 comments on commit 7c10487

Please sign in to comment.