diff --git a/sgl-model-gateway/e2e_test/conftest.py b/sgl-model-gateway/e2e_test/conftest.py index 8a06a831b..7d261a015 100644 --- a/sgl-model-gateway/e2e_test/conftest.py +++ b/sgl-model-gateway/e2e_test/conftest.py @@ -95,7 +95,7 @@ import subprocess import sys from importlib.util import find_spec from pathlib import Path -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any import pytest @@ -660,8 +660,8 @@ def _get_marker_value( request: pytest.FixtureRequest, marker_name: str, arg_index: int = 0, - default: any = None, -) -> any: + default: Any = None, +) -> Any: """Get a value from a pytest marker. Args: @@ -684,8 +684,8 @@ def _get_marker_value( def _get_marker_kwargs( request: pytest.FixtureRequest, marker_name: str, - defaults: dict[str, any] | None = None, -) -> dict[str, any]: + defaults: dict[str, Any] | None = None, +) -> dict[str, Any]: """Get keyword arguments from a pytest marker. Args: diff --git a/sgl-model-gateway/e2e_test/infra/simple_eval_common.py b/sgl-model-gateway/e2e_test/infra/simple_eval_common.py index 86855dc9c..09edc252d 100644 --- a/sgl-model-gateway/e2e_test/infra/simple_eval_common.py +++ b/sgl-model-gateway/e2e_test/infra/simple_eval_common.py @@ -442,7 +442,7 @@ def make_report(eval_result: EvalResult) -> str: ) -def make_report_from_example_htmls(htmls: List[str]): +def make_report_from_example_htmls(htmls: list[str]): """ Create a standalone HTML report from a list of example htmls """ diff --git a/sgl-model-gateway/e2e_test/utils.py b/sgl-model-gateway/e2e_test/utils.py index 6fec3b424..b7b18f23e 100644 --- a/sgl-model-gateway/e2e_test/utils.py +++ b/sgl-model-gateway/e2e_test/utils.py @@ -36,21 +36,6 @@ from infra.model_specs import ( # noqa: F401; Default model paths _resolve_model_path, ) -# ============================================================================= -# Constants -# ============================================================================= - -# Server startup timeout (seconds) -DEFAULT_TIMEOUT = 600 -DEFAULT_STARTUP_TIMEOUT = 300 - -# Default test port range -DEFAULT_PORT_BASE = 20000 - -# File paths for test output -STDOUT_FILENAME = "/tmp/sglang_test_stdout.txt" -STDERR_FILENAME = "/tmp/sglang_test_stderr.txt" - # ============================================================================= # Tokenizer Utilities # ============================================================================= @@ -194,28 +179,5 @@ def is_ci_environment() -> bool: def get_test_timeout() -> int: - """Get test timeout from environment or default.""" - return int(os.environ.get("E2E_TEST_TIMEOUT", str(DEFAULT_TIMEOUT))) - - -def skip_if_no_gpu(): - """Skip test if no GPU is available.""" - import pytest - - try: - import torch - - if not torch.cuda.is_available(): - pytest.skip("No GPU available") - except ImportError: - # Try nvidia-ml-py - try: - import pynvml - - pynvml.nvmlInit() - count = pynvml.nvmlDeviceGetCount() - pynvml.nvmlShutdown() - if count == 0: - pytest.skip("No GPU available") - except Exception: - pytest.skip("Cannot detect GPU (torch and pynvml not available)") + """Get test timeout from environment or default (600 seconds).""" + return int(os.environ.get("E2E_TEST_TIMEOUT", "600"))