# TimeoutError: Test timed out after 30.0 seconds

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

## Root Cause

A test is stuck in an infinite loop, waiting on a resource, or performing a very slow operation that exceeds the timeout limit.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   Add debug prints in the test to identify where it hangs, then fix the infinite loop or blocking call.
   ```
2. **** (85% success)
   ```
   Use a shorter timeout and mock external dependencies to avoid real network calls: `@pytest.mark.timeout(5)`
   ```

## Dead Ends

- **** — This only masks the problem; the test may eventually fail or consume excessive resources. (85% fail)
- **** — Without a timeout, the test suite can hang indefinitely, blocking CI pipelines. (90% fail)
