Skip to content

Conversation

@markmc
Copy link
Member

@markmc markmc commented Dec 2, 2025

This test was added by #28827 and in CI it passes with:

[2025-12-02T03:08:44Z] v1/core/test_reset_prefix_cache_e2e.py::test_reset_prefix_cache_e2e INFO 12-01 19:08:44 [model.py:637] Resolved architecture: Qwen3ForCausalLM ... [2025-12-02T03:08:45Z] WARNING 12-01 19:08:45 [system_utils.py:136] [..] Overriding VLLM_WORKER_MULTIPROC_METHOD to 'spawn'. [..] Reasons: CUDA is initialized 

This doesn't happen if you run locally, standalone, and the test fails with:

E AssertionError: ground_truth_results['ground_truth_0'].outputs[0].text= - but it could cause serious harm. - It is a human preempted_results['preempted_0'].outputs[0].text= - but it could cause serious harm. - This is the case E assert ' - but it c...It is a human' == ' - but it c...s is the case' E E - - but it could cause serious harm. - This is the case E ? ^^ ^^^^ ^^^ ^^ E + - but it could cause serious harm. - It is a human E ? ^^^ ^^ ^^ ^ tests/v1/core/test_reset_prefix_cache_e2e.py:60: AssertionError 

Forcing "spawn" fixes it.

This test was added by vllm-project#28827 and in CI it passes with: ``` [2025-12-02T03:08:44Z] v1/core/test_reset_prefix_cache_e2e.py::test_reset_prefix_cache_e2e INFO 12-01 19:08:44 [model.py:637] Resolved architecture: Qwen3ForCausalLM ... [2025-12-02T03:08:45Z] WARNING 12-01 19:08:45 [system_utils.py:136] [..] Overriding VLLM_WORKER_MULTIPROC_METHOD to 'spawn'. [..] Reasons: CUDA is initialized ``` This doesn't happen if you run locally, standalone, and the test fails with: ``` E AssertionError: ground_truth_results['ground_truth_0'].outputs[0].text= - but it could cause serious harm. - It is a human preempted_results['preempted_0'].outputs[0].text= - but it could cause serious harm. - This is the case E assert ' - but it c...It is a human' == ' - but it c...s is the case' E E - - but it could cause serious harm. - This is the case E ? ^^ ^^^^ ^^^ ^^ E + - but it could cause serious harm. - It is a human E ? ^^^ ^^ ^^ ^ tests/v1/core/test_reset_prefix_cache_e2e.py:60: AssertionError ``` Forcing "spawn" fixes it. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses a test flakiness issue in test_reset_prefix_cache_e2e by forcing the multiprocessing start method to 'spawn'. The change is well-justified, as using 'spawn' is a known and effective way to ensure determinism in tests involving CUDA, preventing issues that can arise from forked processes. The implementation is clean, using pytest's monkeypatch fixture, which is the standard approach for managing environment variables within tests. The change is correct and improves the reliability of the test suite. I have no further comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 participant