Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avocado-instrumented default timeout removal #5728

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
18 changes: 18 additions & 0 deletions selftests/functional/plugin/runners/avocado_instrumented.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from avocado import Test
from avocado.core.exit_codes import AVOCADO_JOB_INTERRUPTED
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.assertEqual(result.exit_status, AVOCADO_JOB_INTERRUPTED)
self.assertIn(
"examples/tests/timeouttest.py:TimeoutTest.test: INTERRUPTED: timeout",
result.stdout_text,
)
Loading