From a7d79fa1331912d533cc0adbf31552ea761104a5 Mon Sep 17 00:00:00 2001 From: Gregory Shtrasberg <156009573+gshtras@users.noreply.github.com> Date: Fri, 3 Apr 2026 04:24:26 -0500 Subject: [PATCH] [ROCm][CI/Build] Fix the pytest hook to properly print out the summary (#38585) Signed-off-by: Gregory Shtrasberg --- docker/Dockerfile.rocm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile.rocm b/docker/Dockerfile.rocm index 6db6d8b835..01a215a293 100644 --- a/docker/Dockerfile.rocm +++ b/docker/Dockerfile.rocm @@ -390,7 +390,20 @@ ENV MIOPEN_DEBUG_CONV_GEMM=0 RUN mkdir src && mv vllm src/vllm # This is a workaround to ensure pytest exits with the correct status code in CI tests. -RUN echo "import os\n\ndef pytest_sessionfinish(session, exitstatus):\n os._exit(int(exitstatus))" > /vllm-workspace/conftest.py +RUN cat << 'EOF' > /vllm-workspace/conftest.py +import os + +_exit_code = 1 + +def pytest_sessionfinish(session, exitstatus): + global _exit_code + _exit_code = int(exitstatus) + +def pytest_unconfigure(config): + sys.stdout.flush() + sys.stderr.flush() + os._exit(_exit_code) +EOF # ----------------------- # Final vLLM image