Add pytest fixture to limit max time a test can take
🐛 Bug
To Reproduce
Steps to reproduce the behavior...
Code sample
# Ideally attach a minimal code sample to reproduce the decried issue.
# Minimal means having the shortest code but still preserving the bug.
Expected behavior
If a test hangs that doesn't have a timeout limit, it'll hang forever. PR #473 was very slow (probably hanging and not progressing). With an autouse fixture, we can set a max timeout of 10 minute or something appropriate.
Additional context
Environment detail
- PyTorch Version (e.g., 1.0):
- OS (e.g., Linux):
- How you installed PyTorch (
conda,pip, source): - Build command you used (if compiling from source):
- Python version:
- CUDA/cuDNN version:
- GPU models and configuration:
- Any other relevant information:
my bad. The test passed, but still, should we have a default max time limit?
https://stackoverflow.com/questions/43598985/how-can-i-set-a-default-per-test-timeout-in-pytest
cc: @tchaton @bhimrazy
For a global max limit, 10 to 20 minutes seems reasonable to me.
And when needed, we can apply the timeout at the test level for specific functions using @pytest.mark.timeout(...).
Closing this issue — the global max time limit is already handled in CI:
https://github.com/Lightning-AI/litData/blob/1a0f48c4a9bcda6b0afe7f8d0d39dc678557f5cf/.github/workflows/ci-testing.yml#L24-L25