|
8 | 8 | import re |
9 | 9 | import json |
10 | 10 | import sys |
11 | | -import threading |
12 | 11 | import requests |
13 | 12 | import time |
14 | 13 | from concurrent.futures import ThreadPoolExecutor, as_completed |
@@ -161,26 +160,12 @@ def start(self, timeout_seconds: int = 10) -> None: |
161 | 160 | self.process = subprocess.Popen( |
162 | 161 | [str(arg) for arg in [server_path, *server_args]], |
163 | 162 | creationflags=flags, |
164 | | - stdout=subprocess.PIPE, |
165 | | - stderr=subprocess.PIPE, |
| 163 | + stdout=sys.stdout, |
| 164 | + stderr=sys.stdout, |
166 | 165 | env={**os.environ, "LLAMA_CACHE": "tmp"}, |
167 | 166 | ) |
168 | 167 | server_instances.add(self) |
169 | 168 |
|
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 | | - |
184 | 169 | print(f"server pid={self.process.pid}, pytest pid={os.getpid()}") |
185 | 170 |
|
186 | 171 | # wait for server to start |
|
0 commit comments