File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,14 +40,15 @@ test-unit *TEST_ARGS:
4040 cargo nextest run {{ TEST_ARGS}}
4141
4242# Python integration test suite. Args are forwarded to pytest
43+ # We run the command with 'timeout 10' to kill pytest if a deadlock were to happen
4344[group (' test' )]
4445test-integration * TEST_ARGS : build-bin build-python
4546 #!/usr/bin/env bash
4647 set -euxo pipefail
4748 cd libs/ opsqueue_python
4849 source " ./.setup_local_venv.sh"
4950
50- pytest --color=yes {{ TEST_ARGS}}
51+ timeout 30 pytest --color=yes {{ TEST_ARGS}}
5152
5253# Python integration test suite, using artefacts built through Nix. Args are forwarded to pytest
5354[group (' nix' )]
Original file line number Diff line number Diff line change @@ -52,10 +52,13 @@ test = [
5252 " pytest==8.3.3" ,
5353 " pytest-random-order==1.1.1" ,
5454 " pytest-parallel==0.1.1" ,
55+ " pytest-timeout==2.4.0" ,
5556 " py==1.11.0" , # Needs to be manually specified because of this issue: https://github.com/kevlened/pytest-parallel/issues/118
5657]
5758
5859[tool .pytest .ini_options ]
5960# We ensure tests never rely on global state,
6061# by running them in a random order, and in parallel:
6162addopts = " --random-order --workers=auto"
63+ # Individual tests should be very fast. If they take longer, this indicates a deadlock
64+ timeout =20
You can’t perform that action at this time.
0 commit comments