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 a 60 second timeout to pytests #5831

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ dependencies = [
"pytest>6.0.0",
"pytest-cov",
"pytest-datadir",
"pytest-timeout",
"requests_testadapter",
"httpx",
]
Expand Down Expand Up @@ -185,9 +186,10 @@ version = { attr = "invokeai.version.__version__" }

#=== Begin: PyTest and Coverage
[tool.pytest.ini_options]
addopts = "--cov-report term --cov-report html --cov-report xml --strict-markers -m \"not slow\""
addopts = "--cov-report term --cov-report html --cov-report xml --timeout=60 --strict-markers -m \"not slow\""
markers = [
"slow: Marks tests as slow. Disabled by default. To run all tests, use -m \"\". To run only slow tests, use -m \"slow\".",
"timeout: Mark a timeout.",
]
[tool.coverage.run]
branch = true
Expand Down
1 change: 1 addition & 0 deletions tests/app/services/download/test_download_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def broken_callback(job: DownloadJob) -> None:
queue.stop()


@pytest.mark.timeout(timeout=20, method="thread")
def test_cancel(tmp_path: Path, session: Session) -> None:
event_bus = TestEventService()

Expand Down
1 change: 1 addition & 0 deletions tests/app/services/model_install/test_model_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ def test_simple_download(mm2_installer: ModelInstallServiceBase, mm2_app_config:
assert event_names == ["model_install_downloading", "model_install_running", "model_install_completed"]


@pytest.mark.timeout(timeout=20, method="thread")
def test_huggingface_download(mm2_installer: ModelInstallServiceBase, mm2_app_config: InvokeAIAppConfig) -> None:
source = URLModelSource(url=Url("https://huggingface.co/stabilityai/sdxl-turbo"))

Expand Down
Loading