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

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

## Root Cause

A test blocked on network I/O, an unclosed socket, a deadlock, or an infinite loop; pytest-timeout killed it after the configured threshold.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   pytest --timeout=60 --timeout-method=thread -o faulthandler_timeout=55 tests/test_net.py
   ```
2. **** (95% success)
   ```
   from unittest import mock

@mock.patch('app.client.requests.get')
def test_fetch(mock_get):
    mock_get.return_value.json.return_value = {"ok": True}
    ...
   ```
3. **** (88% success)
   ```
   @pytest.mark.timeout(5)
def test_quick(): ...
   ```

## Dead Ends

- **** — Extends CI time without fixing the underlying hang. (85% fail)
- **** — CI hangs indefinitely; hides the bug. (95% fail)
- **** — A hang is not flakiness. (90% fail)
