Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeout to unit tests to catch flaky test_dense_image_warp #237

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ requires = [

[tool.setuptools_scm]
write_to = "neuralcompression/version.py"

[tool.pytest.ini_options]
timeout = 300
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ dev =
isort>=5.12.0
mypy>=1.5.1
pytest>=7.4.0
pytest-timeout>=2.3.1
docs =
myst-parser>=0.15.2
sphinx-autodoc-typehints>=1.12.0
Expand All @@ -99,6 +100,7 @@ tests =
opencv-python~=4.8.0.76
pillow==9.4.0
pytest==7.4.0
pytest-timeout==2.3.1
pytorchvideo==0.1.5
scipy==1.11.1
torch==2.0.1
Expand Down
2 changes: 2 additions & 0 deletions tests/functional/test_dense_image_warp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@

import pickle

import pytest
import torch

from neuralcompression.functional import dense_image_warp


@pytest.mark.timeout(method="thread")
def test_dense_image_warp():
with open("tests/cached_data/dense_image_warp.pkl", "rb") as f:
data = pickle.load(f)
Expand Down