From a417c9dc899ef7a0491a2a6a1ad5c3063fafedfe Mon Sep 17 00:00:00 2001 From: Hiran Wijesinghe Date: Thu, 13 Nov 2025 12:15:23 +0000 Subject: [PATCH 1/7] add timeouts to tests --- pyproject.toml | 2 ++ tests/transport/epics/ca/test_softioc_system.py | 2 ++ tests/transport/epics/pva/test_p4p.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index def3a598d..a6ccbc4d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,6 +52,7 @@ dev = [ "pytest-asyncio", "pytest-forked", "pytest-markdown-docs", + "pytest-timeout", "ruff", "sphinx-autobuild", "sphinx-copybutton", @@ -93,6 +94,7 @@ addopts = """ # filterwarnings = "error" # Doctest python code in docs, python code in src docstrings, test functions in tests testpaths = "docs src tests" +timeout = 1 [tool.coverage.run] data_file = "/tmp/fastcs.coverage" diff --git a/tests/transport/epics/ca/test_softioc_system.py b/tests/transport/epics/ca/test_softioc_system.py index bda71d54d..c823352a9 100644 --- a/tests/transport/epics/ca/test_softioc_system.py +++ b/tests/transport/epics/ca/test_softioc_system.py @@ -1,9 +1,11 @@ from multiprocessing import Queue +import pytest from p4p import Value from p4p.client.thread import Context +@pytest.mark.timeout(3) def test_ioc(softioc_subprocess: tuple[str, Queue]): pv_prefix, _ = softioc_subprocess ctxt = Context("pva") diff --git a/tests/transport/epics/pva/test_p4p.py b/tests/transport/epics/pva/test_p4p.py index 2c2ed855c..2d86b8de7 100644 --- a/tests/transport/epics/pva/test_p4p.py +++ b/tests/transport/epics/pva/test_p4p.py @@ -74,6 +74,7 @@ async def test_ioc(p4p_subprocess: tuple[str, Queue]): @pytest.mark.asyncio +@pytest.mark.timeout(4) async def test_scan_method(p4p_subprocess: tuple[str, Queue]): pv_prefix, _ = p4p_subprocess ctxt = Context("pva") @@ -535,6 +536,7 @@ async def _wait_and_put_pvs(): ) +@pytest.mark.timeout(4) def test_command_method_put_twice(caplog): class SomeController(Controller): command_runs_for_a_while_times = [] From 603248a60d6fe68485533e95db9e112bb6421f06 Mon Sep 17 00:00:00 2001 From: Hiran Wijesinghe Date: Thu, 13 Nov 2025 12:20:12 +0000 Subject: [PATCH 2/7] tune timeouts for CI --- tests/transport/epics/pva/test_p4p.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/transport/epics/pva/test_p4p.py b/tests/transport/epics/pva/test_p4p.py index 2d86b8de7..9ad4ec42c 100644 --- a/tests/transport/epics/pva/test_p4p.py +++ b/tests/transport/epics/pva/test_p4p.py @@ -23,6 +23,7 @@ @pytest.mark.asyncio +@pytest.mark.timeout(2) async def test_ioc(p4p_subprocess: tuple[str, Queue]): pv_prefix, _ = p4p_subprocess ctxt = Context("pva") @@ -74,7 +75,7 @@ async def test_ioc(p4p_subprocess: tuple[str, Queue]): @pytest.mark.asyncio -@pytest.mark.timeout(4) +@pytest.mark.timeout(5) async def test_scan_method(p4p_subprocess: tuple[str, Queue]): pv_prefix, _ = p4p_subprocess ctxt = Context("pva") @@ -114,6 +115,7 @@ async def test_scan_method(p4p_subprocess: tuple[str, Queue]): @pytest.mark.asyncio +@pytest.mark.timeout(2) async def test_command_method(p4p_subprocess: tuple[str, Queue]): pv_prefix, _ = p4p_subprocess d_values = asyncio.Queue() @@ -175,6 +177,7 @@ async def test_command_method(p4p_subprocess: tuple[str, Queue]): @pytest.mark.asyncio +@pytest.mark.timeout(2) async def test_numerical_alarms(p4p_subprocess: tuple[str, Queue]): pv_prefix, _ = p4p_subprocess a_values = asyncio.Queue() From fa9bd1f0160f4faea7a7353334e2046e54b96aab Mon Sep 17 00:00:00 2001 From: Hiran Wijesinghe Date: Thu, 13 Nov 2025 12:23:59 +0000 Subject: [PATCH 3/7] tune timeouts for CI --- tests/test_docs_snippets.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_docs_snippets.py b/tests/test_docs_snippets.py index 3d2aaaf5c..c22b9ae8c 100644 --- a/tests/test_docs_snippets.py +++ b/tests/test_docs_snippets.py @@ -37,6 +37,7 @@ def sim_temperature_controller(): print(process.communicate()[0]) +@pytest.mark.timeout(2) @pytest.mark.parametrize("filename", glob.glob("docs/snippets/*.py", recursive=True)) def test_snippet(filename): runpy.run_path(filename) From 7fae7100a4fc1ebb845f9238e228791b60e8e372 Mon Sep 17 00:00:00 2001 From: Hiran Wijesinghe Date: Thu, 13 Nov 2025 12:30:37 +0000 Subject: [PATCH 4/7] tune timeouts for CI --- tests/test_docs_snippets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_docs_snippets.py b/tests/test_docs_snippets.py index c22b9ae8c..4b65acc0f 100644 --- a/tests/test_docs_snippets.py +++ b/tests/test_docs_snippets.py @@ -37,7 +37,7 @@ def sim_temperature_controller(): print(process.communicate()[0]) -@pytest.mark.timeout(2) +@pytest.mark.timeout(10) @pytest.mark.parametrize("filename", glob.glob("docs/snippets/*.py", recursive=True)) def test_snippet(filename): runpy.run_path(filename) From 3d647856f46107db5801ea60ee31c6e0a5329d13 Mon Sep 17 00:00:00 2001 From: Hiran Wijesinghe Date: Thu, 13 Nov 2025 12:34:56 +0000 Subject: [PATCH 5/7] tune timeouts for CI --- tests/test_docs_snippets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_docs_snippets.py b/tests/test_docs_snippets.py index 4b65acc0f..1be484711 100644 --- a/tests/test_docs_snippets.py +++ b/tests/test_docs_snippets.py @@ -37,7 +37,7 @@ def sim_temperature_controller(): print(process.communicate()[0]) -@pytest.mark.timeout(10) +@pytest.mark.timeout(5) @pytest.mark.parametrize("filename", glob.glob("docs/snippets/*.py", recursive=True)) def test_snippet(filename): runpy.run_path(filename) From b9e5aacb77577eaf9e8134392d7b450e769a7835 Mon Sep 17 00:00:00 2001 From: Hiran Wijesinghe Date: Thu, 13 Nov 2025 12:36:48 +0000 Subject: [PATCH 6/7] tune timeouts for CI --- tests/test_docs_snippets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_docs_snippets.py b/tests/test_docs_snippets.py index 1be484711..f56bdf6c8 100644 --- a/tests/test_docs_snippets.py +++ b/tests/test_docs_snippets.py @@ -37,7 +37,7 @@ def sim_temperature_controller(): print(process.communicate()[0]) -@pytest.mark.timeout(5) +@pytest.mark.timeout(4) @pytest.mark.parametrize("filename", glob.glob("docs/snippets/*.py", recursive=True)) def test_snippet(filename): runpy.run_path(filename) From 6edfdb3261031d4cb96d2bc492f5f66fdecae179 Mon Sep 17 00:00:00 2001 From: Hiran Wijesinghe Date: Thu, 13 Nov 2025 12:38:57 +0000 Subject: [PATCH 7/7] tune timeouts for CI --- tests/test_docs_snippets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_docs_snippets.py b/tests/test_docs_snippets.py index f56bdf6c8..799613235 100644 --- a/tests/test_docs_snippets.py +++ b/tests/test_docs_snippets.py @@ -37,7 +37,7 @@ def sim_temperature_controller(): print(process.communicate()[0]) -@pytest.mark.timeout(4) +@pytest.mark.timeout(3) @pytest.mark.parametrize("filename", glob.glob("docs/snippets/*.py", recursive=True)) def test_snippet(filename): runpy.run_path(filename)