Skip to content

Commit 250c873

Browse files
ngxsonarthw
authored andcommitted
server : (tests) don't use thread for capturing stdout/stderr, bump openai client library (ggml-org#10568)
* server : (tests) don't use thread for capturing stdout/stderr * test: bump openai to 1.55.2 * bump openai to 1.55.3
1 parent 7b5d38f commit 250c873

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

examples/server/tests/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ aiohttp~=3.9.3
22
pytest~=8.3.3
33
huggingface_hub~=0.23.2
44
numpy~=1.26.4
5-
openai~=1.30.3
5+
openai~=1.55.3
66
prometheus-client~=0.20.0
77
requests~=2.32.3

examples/server/tests/utils.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import re
99
import json
1010
import sys
11-
import threading
1211
import requests
1312
import time
1413
from concurrent.futures import ThreadPoolExecutor, as_completed
@@ -161,26 +160,12 @@ def start(self, timeout_seconds: int = 10) -> None:
161160
self.process = subprocess.Popen(
162161
[str(arg) for arg in [server_path, *server_args]],
163162
creationflags=flags,
164-
stdout=subprocess.PIPE,
165-
stderr=subprocess.PIPE,
163+
stdout=sys.stdout,
164+
stderr=sys.stdout,
166165
env={**os.environ, "LLAMA_CACHE": "tmp"},
167166
)
168167
server_instances.add(self)
169168

170-
def server_log(in_stream, out_stream):
171-
for line in iter(in_stream.readline, b""):
172-
print(line.decode("utf-8"), end="", file=out_stream)
173-
174-
thread_stdout = threading.Thread(
175-
target=server_log, args=(self.process.stdout, sys.stdout), daemon=True
176-
)
177-
thread_stdout.start()
178-
179-
thread_stderr = threading.Thread(
180-
target=server_log, args=(self.process.stderr, sys.stderr), daemon=True
181-
)
182-
thread_stderr.start()
183-
184169
print(f"server pid={self.process.pid}, pytest pid={os.getpid()}")
185170

186171
# wait for server to start

0 commit comments

Comments
 (0)