Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions tests/integration/defs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import copy
import os
import platform
import random
import re
import socket
import tempfile
Expand Down Expand Up @@ -1162,28 +1163,33 @@ def get_free_port_in_ci(max_attempts=100):
Get a free port in the range [CONTAINER_PORT_START, CONTAINER_PORT_START + CONTAINER_PORT_NUM - 1]
If CONTAINER_PORT_START and CONTAINER_PORT_NUM are not set or all ports are already in use, fallback to get_free_port
"""
global PORTS_IN_USE

container_port_start = int(os.environ.get("CONTAINER_PORT_START", -1))
container_port_num = int(os.environ.get("CONTAINER_PORT_NUM", -1))
if container_port_start != -1 and container_port_num != -1:
for i in range(container_port_num):
port = container_port_start + i
if port in PORTS_IN_USE:
continue
available_ports = [
port for port in range(container_port_start, container_port_start +
container_port_num)
if port not in PORTS_IN_USE
]

for _ in range(len(available_ports)):
# Get a random port from the available ports
port = random.choice(available_ports)

# Check if the port is free
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
try:
s.bind(("localhost", port))

# Port is free, add it to the set of used ports
PORTS_IN_USE.add(port)
return port
except OSError:
# Port is not free, try the next port
available_ports.remove(port)
continue

# No port found in the range, try to get a random free port from the system
for i in range(max_attempts):
for _ in range(max_attempts):
port = get_free_port()
if port not in PORTS_IN_USE:
PORTS_IN_USE.add(port)
Expand Down
1 change: 1 addition & 0 deletions tests/integration/test_lists/waives.txt
Original file line number Diff line number Diff line change
Expand Up @@ -516,3 +516,4 @@ disaggregated/test_auto_scaling.py::test_worker_restart[etcd-round_robin] SKIP (
accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_eagle3_vswa_reuse_4gpus[one_model] SKIP (https://nvbugs/5756028)
accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_eagle3_vswa_reuse_4gpus[two_model] SKIP (https://nvbugs/5756028)
accuracy/test_llm_api_pytorch.py::TestQwen3_30B_A3B::test_fp8[latency-torch_compile=False] SKIP (https://nvbugs/5785206)
examples/test_gpt.py::test_llm_gpt2_parallel_embedding_2gpu[float16-0] SKIP (https://nvbugs/5784518)
Loading