Skip to content

Commit e8477cf

Browse files
committed
test
1 parent cc288b2 commit e8477cf

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

tests/pytest/test_mcp_session_autocreate.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
without requiring a prior initial state fetch, and returns JSON.
44
"""
55

6-
import socket
76
import time
87
from multiprocessing import Process, Queue
98

@@ -17,13 +16,12 @@
1716
def _run_airline_server(port_queue):
1817
import os
1918

20-
# Use dynamic port allocation to avoid conflicts in parallel CI runs
21-
with socket.socket() as s:
22-
s.bind(("", 0))
23-
port = s.getsockname()[1]
19+
# Use different ports based on Python version to avoid conflicts in parallel CI runs
20+
python_version = os.environ.get("PYTHON_VERSION", "3.10").replace(".", "")
21+
port = str(9780 + int(python_version[-2:])) # 9780, 9781, 9782
22+
os.environ["PORT"] = port
2423

25-
port_queue.put(port) # Send the port back to the test
26-
os.environ["PORT"] = str(port)
24+
port_queue.put(int(port)) # Send the port back to the test
2725
from eval_protocol.mcp_servers.tau2.tau2_mcp import AirlineDomainMcp
2826

2927
server = AirlineDomainMcp(seed=None)

0 commit comments

Comments
 (0)