# Failed: Timeout >300.0s

pytest-timeout: test_heavy_import timed out after 300 seconds

- **ID:** `python/pytest-timeout-test-exceeded`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A test exceeded the configured timeout (global or per-test). Often caused by a blocking network call, an unclosed DB transaction waiting on a lock, or a subprocess that never terminates.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   # pyproject.toml
[tool.pytest.ini_options]
addopts = "--timeout=60 --timeout-method=signal"

# per-test
@pytest.mark.timeout(10)
def test_api():
    ...
   ```
2. **** (85% success)
   ```
   pytest -o faulthandler_timeout=30 tests/test_heavy_import.py -s
# or run with py-spy
py-spy dump --pid <pid>
   ```

## Dead Ends

- **** — Hides the real hang; CI now waits an hour per stuck test, and the underlying deadlock persists. (70% fail)
- **** — CI will hang indefinitely on the same test, blocking the whole pipeline. (80% fail)
