diff --git a/tests/config/test_config_utils.py b/tests/config/test_config_utils.py index 1277c7e64..23451c475 100644 --- a/tests/config/test_config_utils.py +++ b/tests/config/test_config_utils.py @@ -164,3 +164,40 @@ def test_classes_are_types(): pass assert endswith_fqname(LocalDummy, ".LocalDummy") + + +def test_envs_compile_factors_stable(): + """Test that envs.compile_factors() hash is stable across fresh initializations. + + Uses subprocesses to ensure env vars with dynamic defaults (like UUIDs) + are freshly generated each time, verifying they're properly ignored. + """ + import subprocess + import sys + + code = """ +import sys +import logging +logging.disable(logging.CRITICAL) +from vllm import envs +from vllm.config.utils import hash_factors +print(hash_factors(envs.compile_factors())) +""" + + def get_hash_in_subprocess(): + result = subprocess.run( + [sys.executable, "-c", code], + capture_output=True, + text=True, + check=True, + env={**dict(__import__("os").environ), "VLLM_LOGGING_LEVEL": "ERROR"}, + ) + return result.stdout.strip() + + hash1 = get_hash_in_subprocess() + hash2 = get_hash_in_subprocess() + + assert hash1 == hash2, ( + "compile_factors hash differs between fresh initializations - " + "dynamic env vars may not be properly ignored" + ) diff --git a/vllm/envs.py b/vllm/envs.py index 97351902b..fb93cc7d7 100755 --- a/vllm/envs.py +++ b/vllm/envs.py @@ -1735,6 +1735,7 @@ def compile_factors() -> dict[str, object]: "VLLM_MAX_AUDIO_CLIP_FILESIZE_MB", "VLLM_VIDEO_LOADER_BACKEND", "VLLM_MEDIA_CONNECTOR", + "VLLM_OBJECT_STORAGE_SHM_BUFFER_NAME", "VLLM_ASSETS_CACHE", "VLLM_ASSETS_CACHE_MODEL_CLEAN", "VLLM_WORKER_MULTIPROC_METHOD",