File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010import socket
1111import threading
1212import time
13- import traceback
1413from collections .abc import AsyncIterator , Generator
1514from contextlib import asynccontextmanager
1615from dataclasses import dataclass , field
@@ -430,43 +429,6 @@ def create_app(
430429 return app
431430
432431
433- def run_server (
434- port : int ,
435- is_json_response_enabled : bool = False ,
436- event_store : EventStore | None = None ,
437- retry_interval : int | None = None ,
438- ) -> None : # pragma: no cover
439- """Run the test server in a subprocess (used only by context_aware_server).
440-
441- Args:
442- port: Port to listen on.
443- is_json_response_enabled: If True, use JSON responses instead of SSE streams.
444- event_store: Optional event store for testing resumability.
445- retry_interval: Retry interval in milliseconds for SSE polling.
446- """
447-
448- app = create_app (is_json_response_enabled , event_store , retry_interval )
449- # Configure server
450- config = uvicorn .Config (
451- app = app ,
452- host = "127.0.0.1" ,
453- port = port ,
454- log_level = "info" ,
455- limit_concurrency = 10 ,
456- timeout_keep_alive = 5 ,
457- access_log = False ,
458- )
459-
460- # Start the server
461- server = uvicorn .Server (config = config )
462-
463- # This is important to catch exceptions and prevent test hangs
464- try :
465- server .run ()
466- except Exception :
467- traceback .print_exc ()
468-
469-
470432def _start_server_thread (
471433 port : int ,
472434 is_json_response_enabled : bool = False ,
You can’t perform that action at this time.
0 commit comments