Skip to content

Commit a189078

Browse files
acul71Suchitra Swain
authored andcommitted
Add timeouts to CI/CD pipeline to prevent hanging tests
- Add 60-minute job timeout to GitHub Actions workflow - Add 20-minute pytest timeouts to tox.ini for all test environments - Update Makefile test command with 20-minute timeout - Prevents tests from hanging indefinitely in CI/CD Fixes #977
1 parent 429015f commit a189078

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.github/workflows/tox.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ defaults:
1414
jobs:
1515
tox:
1616
runs-on: ubuntu-latest
17+
timeout-minutes: 60 # 1 hour timeout
1718
strategy:
1819
matrix:
1920
python: ["3.10", "3.11", "3.12", "3.13"]
@@ -82,6 +83,7 @@ jobs:
8283
8384
windows:
8485
runs-on: windows-latest
86+
timeout-minutes: 60 # 1 hour timeout
8587
strategy:
8688
matrix:
8789
python-version: ["3.11", "3.12", "3.13"]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ typecheck:
4646
pre-commit run mypy-local --all-files && pre-commit run pyrefly-local --all-files
4747

4848
test:
49-
python -m pytest tests -n auto
49+
python -m pytest tests -n auto --timeout=1200
5050

5151
pr: clean fix lint typecheck test
5252

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ max_issue_threshold=1
1919
[testenv]
2020
usedevelop=True
2121
commands=
22-
core: pytest -n auto {posargs:tests/core}
23-
interop: pytest -n auto {posargs:tests/interop}
22+
core: pytest -n auto --timeout=1200 {posargs:tests/core}
23+
interop: pytest -n auto --timeout=1200 {posargs:tests/interop}
2424
docs: make check-docs-ci
25-
demos: pytest -n auto {posargs:tests/core/examples/test_examples.py}
25+
demos: pytest -n auto --timeout=1200 {posargs:tests/core/examples/test_examples.py}
2626
basepython=
2727
docs: python
2828
windows-wheel: python

0 commit comments

Comments
 (0)