From 92d30bf16be9dedf9fbf2c186aaf39a76b30fef7 Mon Sep 17 00:00:00 2001 From: Gilad Katz <29776916+giladk1221@users.noreply.github.com> Date: Wed, 23 Sep 2026 00:41:06 +0300 Subject: [PATCH] revert: restore original workflows and shared test configuration --- .github/workflows/codspeed.yml | 2 -- .github/workflows/test-unit.yml | 8 -------- tests/benchmarks/conftest.py | 7 +------ tests/unit/conftest.py | 2 +- tests/unit/test_socket_policy.py | 7 ++----- 5 files changed, 4 insertions(+), 22 deletions(-) diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 9f4e6cb3607..ec7e211faa1 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -43,8 +43,6 @@ jobs: benchmarks: runs-on: ubuntu-24.04 timeout-minutes: 60 - env: - LITELLM_LOCAL_MODEL_COST_MAP: "True" steps: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index 9fdb9c6f345..49e6d7040d4 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -101,14 +101,6 @@ jobs: timeout-minutes: 20 job-timeout-minutes: 60 - - shard: Web IQ - artifact-name: llm-webiq - test-path: "tests/unit/llms/webiq tests/unit/test_socket_policy.py" - workers: 2 - reruns: 0 - timeout-minutes: 5 - job-timeout-minutes: 45 - - shard: misc artifact-name: misc test-path: >- diff --git a/tests/benchmarks/conftest.py b/tests/benchmarks/conftest.py index 74a53aa6fe5..309ecab9991 100644 --- a/tests/benchmarks/conftest.py +++ b/tests/benchmarks/conftest.py @@ -13,11 +13,10 @@ import sys from collections.abc import Callable, Iterator from concurrent.futures import Future from pathlib import Path -from typing import Final, ParamSpec, TypeVar +from typing import ParamSpec, TypeVar import pytest -from litellm.litellm_core_utils.get_model_cost_map import get_model_cost_map_source_info from litellm.litellm_core_utils.thread_pool_executor import executor P = ParamSpec("P") @@ -25,10 +24,6 @@ R = TypeVar("R") def pytest_configure(config: pytest.Config) -> None: - catalog: Final = get_model_cost_map_source_info() - if catalog["source"] != "local" or not catalog["is_env_forced"]: - raise pytest.UsageError("Set LITELLM_LOCAL_MODEL_COST_MAP=True before importing litellm for benchmarks") - print(f"Benchmark catalog: {catalog['source_revision']} (bundled)") # noqa: T201 # record benchmark input provenance if os.environ.get("LITELLM_REQUIRE_INSTALLED_WHEEL") != "1": return diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index 202ecb80d7b..b3bb19a8b8a 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -11,7 +11,7 @@ import litellm # noqa: E402 # litellm reads LITELLM_LOCAL_MODEL_COST_MAP at im import litellm.router as litellm_router_module # noqa: E402 # same import-time dependency import litellm.utils as litellm_utils_module # noqa: E402 # same import-time dependency -LOOPBACK_HOSTS: Final = ["127.0.0.1", "::1", "localhost"] +LOOPBACK_HOSTS: Final = ["127.0.0.1", "::1"] AMBIENT_AZURE_CREDENTIAL_ENV_VARS: Final = ( "AZURE_AD_TOKEN", "AZURE_TENANT_ID", diff --git a/tests/unit/test_socket_policy.py b/tests/unit/test_socket_policy.py index cee0d1dd19b..f93794d1ba8 100644 --- a/tests/unit/test_socket_policy.py +++ b/tests/unit/test_socket_policy.py @@ -9,12 +9,9 @@ def test_external_connect_is_refused_before_a_packet_leaves() -> None: socket.create_connection(("192.0.2.1", 9), timeout=1) -@pytest.mark.parametrize("host", ["127.0.0.1", "localhost"]) -def test_loopback_connect_is_allowed(host: str) -> None: +def test_loopback_connect_is_allowed() -> None: with socket.socket() as server: server.bind(("127.0.0.1", 0)) server.listen() - with socket.socket() as client: - client.settimeout(1) - client.connect((host, server.getsockname()[1])) + with socket.create_connection(server.getsockname(), timeout=1) as client: assert client.getpeername() == server.getsockname()