Skip to content

Commit a417c9d

Browse files
committed
add timeouts to tests
1 parent 291768b commit a417c9d

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ dev = [
5252
"pytest-asyncio",
5353
"pytest-forked",
5454
"pytest-markdown-docs",
55+
"pytest-timeout",
5556
"ruff",
5657
"sphinx-autobuild",
5758
"sphinx-copybutton",
@@ -93,6 +94,7 @@ addopts = """
9394
# filterwarnings = "error"
9495
# Doctest python code in docs, python code in src docstrings, test functions in tests
9596
testpaths = "docs src tests"
97+
timeout = 1
9698

9799
[tool.coverage.run]
98100
data_file = "/tmp/fastcs.coverage"

tests/transport/epics/ca/test_softioc_system.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
from multiprocessing import Queue
22

3+
import pytest
34
from p4p import Value
45
from p4p.client.thread import Context
56

67

8+
@pytest.mark.timeout(3)
79
def test_ioc(softioc_subprocess: tuple[str, Queue]):
810
pv_prefix, _ = softioc_subprocess
911
ctxt = Context("pva")

tests/transport/epics/pva/test_p4p.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ async def test_ioc(p4p_subprocess: tuple[str, Queue]):
7474

7575

7676
@pytest.mark.asyncio
77+
@pytest.mark.timeout(4)
7778
async def test_scan_method(p4p_subprocess: tuple[str, Queue]):
7879
pv_prefix, _ = p4p_subprocess
7980
ctxt = Context("pva")
@@ -535,6 +536,7 @@ async def _wait_and_put_pvs():
535536
)
536537

537538

539+
@pytest.mark.timeout(4)
538540
def test_command_method_put_twice(caplog):
539541
class SomeController(Controller):
540542
command_runs_for_a_while_times = []

0 commit comments

Comments
 (0)