Skip to content

Commit c567d58

Browse files
Add per-test case timeouts to flow tests
Adds a per testcase timeout for tests in backends/test/suite. The timeout is set to 1200s for models and 120s for ops. Signed-off-by: Oscar Andersson <oscar.andersson@arm.com> Change-Id: Iebf0d520953a10b2e7934b7f3540a2e6a2806e38
1 parent 42b03d7 commit c567d58

1 file changed

Lines changed: 25 additions & 10 deletions

File tree

backends/test/suite/conftest.py

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright 2026 Arm Limited and/or its affiliates.
2+
#
3+
# This source code is licensed under the BSD-style license found in the
4+
# LICENSE file in the root directory of this source tree.
5+
16
import os
27
from typing import Any
38

@@ -9,19 +14,29 @@
914
from executorch.backends.test.suite.runner import run_test
1015

1116

17+
FLOW_TEST_CASE_TIMEOUTS = {
18+
"backends/test/suite/models/": 1200,
19+
"backends/test/suite/operators/": 120,
20+
}
21+
22+
1223
def pytest_collection_modifyitems(config, items):
1324
for item in items:
1425
callspec = getattr(item, "callspec", None)
15-
if callspec is None:
16-
continue
17-
flow = callspec.params.get("test_runner")
18-
if not isinstance(flow, TestFlow):
19-
continue
20-
test_name = item.originalname or item.name
21-
if flow.should_skip_test(test_name):
22-
item.add_marker(
23-
pytest.mark.skip(reason=f"Skipped by {flow.name} skip_patterns")
24-
)
26+
if callspec is not None:
27+
flow = callspec.params.get("test_runner")
28+
if isinstance(flow, TestFlow):
29+
test_name = item.originalname or item.name
30+
if flow.should_skip_test(test_name):
31+
item.add_marker(
32+
pytest.mark.skip(reason=f"Skipped by {flow.name} skip_patterns")
33+
)
34+
35+
item_path = str(getattr(item, "path", ""))
36+
for suite_prefix, timeout_s in FLOW_TEST_CASE_TIMEOUTS.items():
37+
if suite_prefix in item_path:
38+
item.add_marker(pytest.mark.timeout(timeout_s))
39+
break
2540

2641

2742
def pytest_configure(config):

0 commit comments

Comments
 (0)