Skip to content
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
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Copyright (c) 2023-2026 Robotics and AI Institute LLC dba RAI Institute. All rig
<test_depend>python3-prompt-toolkit</test_depend>
<test_depend>python3-pytest</test_depend>
<test_depend>python3-pytest-cov</test_depend>
<test_depend>python3-pytest-timeout</test_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ target-version = ["py310"]
[tool.isort]
profile = "black"
line_length = 120

[tool.pytest.ini_options]
# Consider any test running longer than 4 minutes hung
timeout = 240
# Use "thread" in case we encounter a hang in ROS extension
timeout_method = "thread"
13 changes: 13 additions & 0 deletions test/system/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,16 @@ def hardware_spot_graph_description(

def pytest_configure() -> None:
pytest.hardware_spot_graph_description = hardware_spot_graph_description


def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
"""Exempt the system tests from the global pytest-timeout limit.

These tests drive real hardware and block on interactive prompts, so wall
clock time is not a meaningful signal of a hang the way it is for the unit
tests.
"""
system_test_dir = str(pathlib.Path(__file__).parent)
for item in items:
if str(item.fspath).startswith(system_test_dir):
item.add_marker(pytest.mark.timeout(0))
Loading