diff --git a/.buildkite/test-pipeline.yaml b/.buildkite/test-pipeline.yaml index 4e7bea25e171..46785a8b3d50 100644 --- a/.buildkite/test-pipeline.yaml +++ b/.buildkite/test-pipeline.yaml @@ -199,8 +199,9 @@ steps: - tests/test_sequence - tests/test_config - tests/test_logger + - tests/test_vllm_port commands: - - pytest -v -s engine test_sequence.py test_config.py test_logger.py + - pytest -v -s engine test_sequence.py test_config.py test_logger.py test_vllm_port.py # OOM in the CI unless we run this separately - pytest -v -s tokenization diff --git a/vllm/envs.py b/vllm/envs.py index 785fe73098be..dc52bbd8edbc 100644 --- a/vllm/envs.py +++ b/vllm/envs.py @@ -159,17 +159,13 @@ def get_vllm_port() -> Optional[int]: return int(port) except ValueError as err: from urllib.parse import urlparse - try: - parsed = urlparse(port) - if parsed.scheme: - raise ValueError( - f"VLLM_PORT '{port}' appears to be a URI. " - "This may be caused by a Kubernetes service discovery issue" - "check the warning in: https://docs.vllm.ai/en/stable/usage/env_vars.html" - ) - except Exception: - pass - + parsed = urlparse(port) + if parsed.scheme: + raise ValueError( + f"VLLM_PORT '{port}' appears to be a URI. " + "This may be caused by a Kubernetes service discovery issue," + "check the warning in: https://docs.vllm.ai/en/stable/serving/env_vars.html" + ) from None raise ValueError( f"VLLM_PORT '{port}' must be a valid integer") from err