Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norm
vllm
Commits
66b108d1
Unverified
Commit
66b108d1
authored
Dec 27, 2023
by
Zhuohan Li
Committed by
GitHub
Dec 26, 2023
Browse files
[BUGFIX] Fix API server test (#2270)
parent
e0ff9200
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
tests/async_engine/test_api_server.py
tests/async_engine/test_api_server.py
+8
-6
No files found.
tests/async_engine/test_api_server.py
View file @
66b108d1
...
...
@@ -44,13 +44,14 @@ def test_api_server(api_server):
"""
with
Pool
(
32
)
as
pool
:
# Wait until the server is ready
prompts
=
[
"
Hello world
"
]
*
1
prompts
=
[
"
warm up
"
]
*
1
result
=
None
while
not
result
:
try
:
for
_
in
pool
.
map
(
_query_server
,
prompts
):
for
r
in
pool
.
map
(
_query_server
,
prompts
):
result
=
r
break
except
Exception
:
except
requests
.
exceptions
.
ConnectionError
:
time
.
sleep
(
1
)
# Actual tests start here
...
...
@@ -63,13 +64,14 @@ def test_api_server(api_server):
assert
num_aborted_requests
==
0
# Try with 100 prompts
prompts
=
[
"
Hello world
"
]
*
100
prompts
=
[
"
test prompt
"
]
*
100
for
result
in
pool
.
map
(
_query_server
,
prompts
):
assert
result
# Cancel requests
prompts
=
[
"canceled requests"
]
*
100
pool
.
map_async
(
_query_server
,
prompts
)
time
.
sleep
(
0.01
)
time
.
sleep
(
0.
0
01
)
pool
.
terminate
()
pool
.
join
()
...
...
@@ -81,6 +83,6 @@ def test_api_server(api_server):
# check that server still runs after cancellations
with
Pool
(
32
)
as
pool
:
# Try with 100 prompts
prompts
=
[
"
Hello worl
d"
]
*
100
prompts
=
[
"
test prompt after cancele
d"
]
*
100
for
result
in
pool
.
map
(
_query_server
,
prompts
):
assert
result
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment