diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a2b25f30..bfe19439f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: suite: runs-on: ubuntu-latest # A hung test must turn red in minutes, not burn GitHub's 6-hour default. - timeout-minutes: 30 + timeout-minutes: 60 steps: - uses: actions/checkout@v4 with: @@ -85,4 +85,4 @@ jobs: # xdist reports a collection error as a worker crash; collect alone first so it reads as one. - run: .venv/bin/pytest --collect-only -q # A test stuck past 120 s dumps every thread, so the red names where it hung. - - run: .venv/bin/pytest -n auto --basetemp .artifacts/pilots -o faulthandler_timeout=120 -rfE -vv --tb=short + - run: .venv/bin/pytest -n auto --basetemp .artifacts/pilots -o faulthandler_timeout=120 -rfE -vv --tb=short --durations=40 diff --git a/tests/conftest.py b/tests/conftest.py index eead05fcc..09e3ab779 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -121,6 +121,15 @@ def pytest_collection_modifyitems(config, items): item.add_report_section("call", "Recorded defect", note) +def pytest_unconfigure(config): + """Helpers inherit this process's pipes; the runner reads until they close, so a test + whose close failed would otherwise run out its whole timeout after it already reported.""" + if (attempt := os.environ.get(ATTEMPT)) is not None: + from support.processes import stop_test_children + + asyncio.run(stop_test_children(attempt)) + + def pytest_runtest_logreport(report): if (path := os.environ.get(RESULT)) is None: return