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

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

## Root Cause

A test blocks longer than the configured timeout, often due to a network call, deadlock, or an unclosed resource waiting on input.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 7.x | active | — | — |
| 8.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   from unittest import mock

def test_fetch(monkeypatch):
    monkeypatch.setattr('myapp.client.requests.get', lambda *a, **k: FakeResp())
    assert myapp.client.fetch()
   ```
2. **** (85% success)
   ```
   # pytest.ini
[pytest]
timeout = 60
timeout_method = signal
# on failure, pytest prints the stack where the test hung
   ```

## Dead Ends

- **** — Hides the underlying hang; CI duration balloons and the real bug (deadlock, missing mock) persists. (85% fail)
- **** — Test suite hangs indefinitely in CI, blocking the whole pipeline until the job-level timeout. (95% fail)
- **** — Loses coverage and leaves the bug in production code undetected. (90% fail)
