Skip to content

Commit

Permalink
Protect against local DNS misconfiguration (#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
smokestacklightnin authored Jan 28, 2025
1 parent bf1fefe commit 2a3c571
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/assistants/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import itertools
import json
import os
import sys
from pathlib import Path

import httpx
Expand Down Expand Up @@ -40,7 +41,7 @@ async def test_api_call_error_smoke(mocker, assistant):
@pytest.fixture
def streaming_server():
port = get_available_port()
base_url = f"http://localhost:{port}"
base_url = f"http://127.0.0.1:{port}"

def check_fn():
try:
Expand All @@ -49,6 +50,8 @@ def check_fn():
return False

with BackgroundSubprocess(
sys.executable,
"-m",
"uvicorn",
f"--app-dir={Path(__file__).parent}",
f"--port={port}",
Expand Down

0 comments on commit 2a3c571

Please sign in to comment.