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
change
sglang
Commits
de89ef49
Unverified
Commit
de89ef49
authored
Oct 03, 2025
by
Liangsheng Yin
Committed by
GitHub
Oct 03, 2025
Browse files
[CI]] Tee server logs to both file and stdout/stderr using PIPE (#11185)
parent
b00a0c78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
python/sglang/test/test_utils.py
python/sglang/test/test_utils.py
+22
-2
No files found.
python/sglang/test/test_utils.py
View file @
de89ef49
...
...
@@ -9,6 +9,7 @@ import os
import
random
import
re
import
subprocess
import
sys
import
threading
import
time
import
unittest
...
...
@@ -566,11 +567,30 @@ def popen_launch_server(
if
return_stdout_stderr
:
process
=
subprocess
.
Popen
(
command
,
stdout
=
return_stdout_stderr
[
0
]
,
stderr
=
return_stdout_stderr
[
1
]
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
env
=
env
,
text
=
True
,
bufsize
=
1
,
)
def
_dump
(
src
,
sinks
):
for
line
in
iter
(
src
.
readline
,
""
):
for
sink
in
sinks
:
sink
.
write
(
line
)
sink
.
flush
()
src
.
close
()
threading
.
Thread
(
target
=
_dump
,
args
=
(
process
.
stdout
,
[
return_stdout_stderr
[
0
],
sys
.
stdout
]),
daemon
=
True
,
).
start
()
threading
.
Thread
(
target
=
_dump
,
args
=
(
process
.
stderr
,
[
return_stdout_stderr
[
1
],
sys
.
stderr
]),
daemon
=
True
,
).
start
()
else
:
process
=
subprocess
.
Popen
(
command
,
stdout
=
None
,
stderr
=
None
,
env
=
env
)
...
...
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