Skip to content

Commit 3d28ad1

Browse files
Varun SharmaCopilot
andcommitted
Fix coverage: simplify test by removing unnecessary retry loop
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c152ca5 commit 3d28ad1

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

tests/shared/test_sse.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -638,14 +638,9 @@ def on_session_created(session_id: str) -> None:
638638
# After disconnect, POST to the stale session should return 404
639639
# (not 202 as it did before the fix)
640640
async with httpx.AsyncClient() as client:
641-
with anyio.fail_after(5):
642-
while True:
643-
response = await client.post(
644-
f"{server_url}/messages/?session_id={captured_session_id}",
645-
json={"jsonrpc": "2.0", "method": "ping", "id": 99},
646-
headers={"Content-Type": "application/json"},
647-
)
648-
if response.status_code == 404:
649-
break
650-
await anyio.sleep(0.1)
641+
response = await client.post(
642+
f"{server_url}/messages/?session_id={captured_session_id}",
643+
json={"jsonrpc": "2.0", "method": "ping", "id": 99},
644+
headers={"Content-Type": "application/json"},
645+
)
651646
assert response.status_code == 404

0 commit comments

Comments
 (0)