Skip to content

Commit e9af965

Browse files
authored
Merge pull request #979 from libp2p/fix/issue-977-add-timeouts-cicd
Add timeouts to CI/CD pipeline to prevent hanging tests
2 parents 894a6c3 + 6e2951e commit e9af965

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-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

newsfragments/977.internal.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Added timeouts to CI/CD pipeline to prevent hanging tests.
2+
3+
- Added 60-minute job timeout to GitHub Actions workflow
4+
- Added 20-minute pytest timeouts to tox.ini for all test environments
5+
- Updated Makefile test command with 20-minute timeout
6+
- Prevents tests from hanging indefinitely in CI/CD

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)