Skip to content

Commit 229ec37

Browse files
committed
Tweak test timeouts
1 parent c7d75d9 commit 229ec37

File tree

6 files changed

+5
-15
lines changed

6 files changed

+5
-15
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ addopts = """
9595
filterwarnings = "error"
9696
# Doctest python code in docs, python code in src docstrings, test functions in tests
9797
testpaths = "docs src tests"
98-
timeout = 1
98+
timeout = 5
9999

100100
[tool.coverage.run]
101101
patch = ["subprocess"]

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def run_ioc_as_subprocess(
143143
if time.monotonic() - start_time > ioc_startup_timeout:
144144
raise ioc_startup_timeout_error
145145

146-
time.sleep(0.1)
146+
time.sleep(0.5)
147147
yield pv_prefix, stdout_queue
148148

149149
finally:

tests/example_softioc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def run(pv_prefix="SOFTIOC_TEST_DEVICE"):
3737
)
3838
],
3939
)
40-
fastcs.run(interactive=True)
40+
fastcs.run(interactive=False)
4141

4242

4343
if __name__ == "__main__":

tests/test_docs_snippets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def sim_temperature_controller():
3737
print(process.communicate()[0])
3838

3939

40-
@pytest.mark.timeout(5)
40+
@pytest.mark.timeout(10)
4141
@pytest.mark.parametrize("filename", glob.glob("docs/snippets/*.py", recursive=True))
4242
def test_snippet(filename):
4343
runpy.run_path(filename)

tests/transports/epics/ca/test_softioc_system.py

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

3-
import pytest
43
from p4p import Value
54
from p4p.client.thread import Context
65

76

8-
@pytest.mark.timeout(3)
97
def test_ioc(softioc_subprocess: tuple[str, Queue]):
108
pv_prefix, _ = softioc_subprocess
119
ctxt = Context("pva")

tests/transports/epics/pva/test_p4p.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424

2525
@pytest.mark.asyncio
26-
@pytest.mark.timeout(2)
2726
async def test_ioc(p4p_subprocess: tuple[str, Queue]):
2827
pv_prefix, _ = p4p_subprocess
2928
ctxt = Context("pva")
@@ -75,7 +74,6 @@ async def test_ioc(p4p_subprocess: tuple[str, Queue]):
7574

7675

7776
@pytest.mark.asyncio
78-
@pytest.mark.timeout(5)
7977
async def test_scan_method(p4p_subprocess: tuple[str, Queue]):
8078
pv_prefix, _ = p4p_subprocess
8179
ctxt = Context("pva")
@@ -115,7 +113,6 @@ async def test_scan_method(p4p_subprocess: tuple[str, Queue]):
115113

116114

117115
@pytest.mark.asyncio
118-
@pytest.mark.timeout(2)
119116
async def test_command_method(p4p_subprocess: tuple[str, Queue]):
120117
pv_prefix, _ = p4p_subprocess
121118
d_values = asyncio.Queue()
@@ -177,7 +174,6 @@ async def test_command_method(p4p_subprocess: tuple[str, Queue]):
177174

178175

179176
@pytest.mark.asyncio
180-
@pytest.mark.timeout(2)
181177
async def test_numeric_alarms(p4p_subprocess: tuple[str, Queue]):
182178
pv_prefix, _ = p4p_subprocess
183179
a_values = asyncio.Queue()
@@ -528,7 +524,6 @@ async def _wait_and_put_pvs():
528524
)
529525

530526

531-
@pytest.mark.timeout(4)
532527
def test_command_method_put_twice(caplog):
533528
class SomeController(Controller):
534529
command_runs_for_a_while_times = []
@@ -579,10 +574,7 @@ async def put_pvs():
579574
serve = asyncio.ensure_future(fastcs.serve(interactive=False))
580575
try:
581576
asyncio.get_event_loop().run_until_complete(
582-
asyncio.wait_for(
583-
asyncio.gather(serve, put_pvs()),
584-
timeout=3,
585-
)
577+
asyncio.wait_for(asyncio.gather(serve, put_pvs()), timeout=1)
586578
)
587579
except TimeoutError:
588580
...

0 commit comments

Comments
 (0)