Skip to content

Commit 3b53fb9

Browse files
fix: add HTTP readiness check to wait_for_server and remove dead code in SSE tests (#2073)
1 parent 2fe56e5 commit 3b53fb9

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

tests/shared/test_sse.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import json
22
import multiprocessing
33
import socket
4-
import time
54
from collections.abc import AsyncGenerator, Generator
65
from typing import Any
76
from unittest.mock import AsyncMock, MagicMock, Mock, patch
@@ -134,11 +133,6 @@ def run_server(server_port: int) -> None: # pragma: no cover
134133
print(f"starting server on {server_port}")
135134
server.run()
136135

137-
# Give server time to start
138-
while not server.started:
139-
print("waiting for server to start")
140-
time.sleep(0.5)
141-
142136

143137
@pytest.fixture()
144138
def server(server_port: int) -> Generator[None, None, None]:
@@ -313,11 +307,6 @@ def run_mounted_server(server_port: int) -> None: # pragma: no cover
313307
print(f"starting server on {server_port}")
314308
server.run()
315309

316-
# Give server time to start
317-
while not server.started:
318-
print("waiting for server to start")
319-
time.sleep(0.5)
320-
321310

322311
@pytest.fixture()
323312
def mounted_server(server_port: int) -> Generator[None, None, None]:

tests/shared/test_ws.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import multiprocessing
22
import socket
3-
import time
43
from collections.abc import AsyncGenerator, Generator
54
from urllib.parse import urlparse
65

@@ -114,11 +113,6 @@ def run_server(server_port: int) -> None: # pragma: no cover
114113
print(f"starting server on {server_port}")
115114
server.run()
116115

117-
# Give server time to start
118-
while not server.started:
119-
print("waiting for server to start")
120-
time.sleep(0.5)
121-
122116

123117
@pytest.fixture()
124118
def server(server_port: int) -> Generator[None, None, None]:

0 commit comments

Comments
 (0)