Skip to content

Commit

Permalink
Avocado-instrumented default timeout removal
Browse files Browse the repository at this point in the history
This will remove unsystematic timeout inside avocado-instrumented
runner. This timeout has been set to 24 hours and users haven't had a
way how to change it. Because we solved problems with
`task.timeout.running` in avocado-framework#5383 and `job-timeout` in avocado-framework#5295 this default
timeout is not needed anymore. After this change, the users will have
more power over timeouts and will be able to run instrumented tests
longer than 24 hours.

Reference: avocado-framework#5394
Signed-off-by: Jan Richter <jarichte@redhat.com>
  • Loading branch information
richtja committed Jul 17, 2023
1 parent 5fbbe16 commit fe773aa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
6 changes: 2 additions & 4 deletions avocado/plugins/runners/avocado_instrumented.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ class and method names should be separated by a ":". One
"job.run.store_logging_stream",
]

DEFAULT_TIMEOUT = 86400

@staticmethod
def _create_params(runnable):
"""Create params for the test"""
Expand Down Expand Up @@ -145,7 +143,7 @@ def run(self, runnable):

time_started = time.monotonic()

timeout = float(self.DEFAULT_TIMEOUT)
timeout = float("inf")
next_status_time = None
while True:
time.sleep(RUNNER_RUN_CHECK_INTERVAL)
Expand All @@ -161,7 +159,7 @@ def run(self, runnable):
else:
message = queue.get()
if message.get("type") == "early_state":
timeout = float(message.get("timeout") or self.DEFAULT_TIMEOUT)
timeout = float(message.get("timeout") or float("inf"))
else:
yield message
if message.get("status") == "finished":
Expand Down
16 changes: 16 additions & 0 deletions selftests/functional/plugin/runners/avocado_instrumented.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from avocado import Test
from avocado.utils import process
from selftests.utils import AVOCADO, TestCaseTmpDir


class AvocadoInstrumentedRunnerTest(TestCaseTmpDir, Test):
def test_timeout(self):
cmd_line = (
f"{AVOCADO} run --job-results-dir {self.tmpdir.name} "
f"-- examples/tests/timeouttest.py "
)
result = process.run(cmd_line, ignore_status=True)
self.assertIn(
"examples/tests/timeouttest.py:TimeoutTest.test: INTERRUPTED: timeout",
result.stdout_text,
)

0 comments on commit fe773aa

Please sign in to comment.