Skip to content

Commit 17ea795

Browse files
authored
mark vLLM policy integration tests as async (#416)
1 parent 703f419 commit 17ea795

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

tests/integration_tests/test_vllm_policy_correctness.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
66

7-
import asyncio
7+
import pytest
88

99
from forge.actors.policy import Policy
1010
from vllm import SamplingParams
@@ -28,6 +28,7 @@
2828
N_SAMPLES = 1
2929

3030

31+
@pytest.mark.asyncio
3132
async def test_same_output():
3233
"""Compare outputs between vLLM and Policy service"""
3334
test_prompts = [
@@ -96,15 +97,14 @@ async def test_same_output():
9697
for vllm_output, policy_output in zip(vllm_outputs, policy_outputs):
9798
assert vllm_output != ""
9899
assert policy_output != ""
99-
if vllm_output != policy_output:
100-
print(f"❌ Got different results: {vllm_output} vs. {policy_output}")
101-
print("✅ Outputs are the same!")
100+
assert vllm_output == policy_output
102101

103102
finally:
104103
if policy is not None:
105104
await policy.shutdown()
106105

107106

107+
@pytest.mark.asyncio
108108
async def test_cache_usage():
109109
"""Test that KV cache usage is consistent between vLLM and Policy service.
110110
@@ -232,16 +232,8 @@ async def test_cache_usage():
232232
for vllm_output, policy_output in zip(vllm_outputs, policy_outputs):
233233
assert vllm_output != ""
234234
assert policy_output != ""
235-
if vllm_output != policy_output:
236-
print(f"❌ Got different results: {vllm_output} vs. {policy_output}")
237-
238-
print("\n✅ Prefix cache usage is the same!")
235+
assert vllm_output == policy_output
239236

240237
finally:
241238
if policy is not None:
242239
await policy.shutdown()
243-
244-
245-
if __name__ == "__main__":
246-
asyncio.run(test_same_output())
247-
asyncio.run(test_cache_usage())

0 commit comments

Comments
 (0)