Unverified Commit 54636097 authored by Jacky's avatar Jacky Committed by GitHub
Browse files

test: Add pre-download model test that run at beginning avoiding individual test timeout (#4989)


Signed-off-by: default avatarJacky <18255193+kthui@users.noreply.github.com>
parent 6b8bb99a
......@@ -23,6 +23,7 @@ pytest-forked==1.6.0
pytest-httpserver==1.1.3
pytest-md-report==0.7.0
pytest-mypy==1.0.1
pytest-order==1.3.0
pytest-timeout==2.4.0
pytest-xdist==3.8.0
# Triton client to Dynamo gRPC server
......
......@@ -140,7 +140,6 @@ known_first_party = ["dynamo"]
[tool.pytest.ini_options]
minversion = "8.0"
tmp_path_retention_policy = "failed"
timeout_func_only = true
# NOTE
# We ignore model.py explicitly here to avoid mypy errors with duplicate modules
......
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Test module to trigger model predownloading before any other tests run.
This module uses pytest-order to ensure the predownload_models fixture
is executed at the very beginning of the test session, downloading all
required models before other tests attempt to use them.
The tests use parametrization with pytest.param marks to match different
CI marker expressions (e.g., "vllm and e2e and gpu_1").
"""
import pytest
@pytest.mark.order("first")
@pytest.mark.pre_merge
@pytest.mark.parametrize(
"predownload_models_variant",
[
pytest.param(
"predownload_models_vllm_gpu1",
marks=[pytest.mark.vllm, pytest.mark.e2e, pytest.mark.gpu_1],
),
pytest.param(
"predownload_models_sglang_gpu1",
marks=[pytest.mark.sglang, pytest.mark.e2e, pytest.mark.gpu_1],
),
pytest.param(
"predownload_models_trtllm_gpu1",
marks=[pytest.mark.trtllm, pytest.mark.e2e, pytest.mark.gpu_1],
),
pytest.param(
"predownload_models_vllm_gpu2",
marks=[pytest.mark.vllm, pytest.mark.e2e, pytest.mark.gpu_2],
),
pytest.param(
"predownload_models_sglang_gpu2",
marks=[pytest.mark.sglang, pytest.mark.e2e, pytest.mark.gpu_2],
),
pytest.param(
"predownload_models_trtllm_gpu2",
marks=[pytest.mark.trtllm, pytest.mark.e2e, pytest.mark.gpu_2],
),
],
)
def test_predownload_models(predownload_models_variant, predownload_models):
"""Trigger the predownload_models fixture to download all required models.
This test runs before any other tests in the session due to pytest.mark.order("first").
By downloading models upfront, we ensure that model download time is not counted
against individual test timeouts. This prevents tests from failing due to slow
network downloads rather than actual test failures.
The actual download logic is handled by the predownload_models session-scoped fixture
defined in conftest.py.
The parametrization ensures this test is selected by any CI marker expression
that matches framework-specific E2E tests (e.g., "vllm and e2e and gpu_1").
"""
# The fixture handles the download - this test just ensures it runs first
pass
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment