# Failed: Timeout (>30.0s) from pytest-timeout.

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

## Root Cause

A test blocks on I/O (network, subprocess, lock) longer than the configured timeout. pytest-timeout kills the test but the underlying hang often indicates a missing mock or a deadlock.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Use the thread method to get a Python traceback at timeout:

pytest --timeout=30 --timeout-method=thread -s
   ```
2. **** (95% success)
   ```
   Mock the blocking dependency (e.g. requests.get) or use a fake server; this usually reveals the missing mock.
   ```

## Dead Ends

- **** — Slows the suite and hides the real hang; CI eventually times out at the job level. (70% fail)
- **** — Hung tests block CI indefinitely, requiring manual cancellation. (90% fail)
