# Failed: Timeout >30.0s

- **ID:** `python/pytest-timeout-failed`
- **Domain:** python
- **Category:** system_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

pytest-timeout aborts a test that exceeds its configured timeout. Often caused by a blocking network call, a deadlock on a lock, or a sleep not being mocked.

## Version Compatibility

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

## Workarounds

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

@patch('app.client.requests.get')
def test_fetch(mock_get):
    mock_get.return_value.json.return_value = {'ok': True}
    assert fetch()['ok'] is True
   ```
2. **** (85% success)
   ```
   # pyproject.toml
[tool.pytest.ini_options]
timeout = 30
timeout_method = "thread"

# on failure a stack trace of the hung thread is printed
   ```

## Dead Ends

- **** — Masks the real issue; the underlying hang will still occur and slow CI. (75% fail)
- **** — Removes the safety net; a truly hung test blocks the whole run until the CI job times out. (80% fail)
