[CI] Keep vLLM log propagation on through the first LLM init in caplog_vllm (#61535)
Signed-off-by: khluu <khluu000@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Bugen Zhao <i@bugenzhao.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
Bugen Zhao
parent
badfcdbf91
commit
ec317a4618
+7
-6
@@ -1406,14 +1406,15 @@ def vllm_runner():
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def temporary_enable_log_propagate():
|
||||
def temporary_enable_log_propagate(monkeypatch):
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger("vllm")
|
||||
previous_propagate = logger.propagate
|
||||
logger.propagate = True
|
||||
yield
|
||||
logger.propagate = previous_propagate
|
||||
from vllm.logger import DEFAULT_LOGGING_CONFIG
|
||||
|
||||
# The first LLM init in a process reapplies DEFAULT_LOGGING_CONFIG, which
|
||||
# would otherwise turn propagation back off mid-test.
|
||||
monkeypatch.setitem(DEFAULT_LOGGING_CONFIG["loggers"]["vllm"], "propagate", True)
|
||||
monkeypatch.setattr(logging.getLogger("vllm"), "propagate", True)
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
|
||||
@@ -69,7 +69,6 @@ def test_inject_into_mm_cache(
|
||||
mm_processor_cache_type,
|
||||
caplog_vllm,
|
||||
vllm_runner,
|
||||
monkeypatch,
|
||||
):
|
||||
"""Test that inject_into_mm_cache() injects pre-processed mm_kwargs into
|
||||
the processor cache and MM cache hit metrics are updated correctly.
|
||||
@@ -88,9 +87,6 @@ def test_inject_into_mm_cache(
|
||||
limit_mm_per_prompt={"image": 2},
|
||||
mm_processor_cache_type=mm_processor_cache_type,
|
||||
) as runner:
|
||||
# The first LLM initialization can reset logger propagation.
|
||||
monkeypatch.setattr(logging.getLogger("vllm"), "propagate", True)
|
||||
|
||||
# Step 1: Normal requests to populate the cache
|
||||
runner.llm.chat(_make_messages(image_urls[0]))
|
||||
assert _get_mm_cache_stats(runner.llm.get_metrics()) == (1, 0)
|
||||
|
||||
Reference in New Issue
Block a user