Skip to content
Closed
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
2 changes: 1 addition & 1 deletion ci/run_cuopt_pytests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ rc=0
if [ "${IS_NIGHTLY}" = "nightly" ]; then
pytest -s --cache-clear --reruns 2 --reruns-delay 5 -p cuopt_rerun_xml "$@" tests || rc=$?
else
pytest -s --cache-clear "$@" tests || rc=$?
pytest -s --cache-clear -n 8 "$@" tests || rc=$?
fi

# If not a crash, exit normally
Expand Down
2 changes: 1 addition & 1 deletion ci/run_cuopt_server_pytests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ rc=0
if [ "${IS_NIGHTLY}" = "nightly" ]; then
pytest -s --cache-clear --reruns 2 --reruns-delay 5 -p cuopt_rerun_xml "$@" tests || rc=$?
else
pytest -s --cache-clear "$@" tests || rc=$?
pytest -s --cache-clear -n 8 "$@" tests || rc=$?
fi

if [ "${rc}" -le 128 ]; then
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-129_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ dependencies:
- pyrsistent
- pytest-cov
- pytest-rerunfailures
- pytest-xdist
- pytest<9.0
- python>=3.11,<3.15
- pyyaml>=6.0.0
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-129_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ dependencies:
- pyrsistent
- pytest-cov
- pytest-rerunfailures
- pytest-xdist
- pytest<9.0
- python>=3.11,<3.15
- pyyaml>=6.0.0
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-133_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ dependencies:
- pyrsistent
- pytest-cov
- pytest-rerunfailures
- pytest-xdist
- pytest<9.0
- python>=3.11,<3.15
- pyyaml>=6.0.0
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-133_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ dependencies:
- pyrsistent
- pytest-cov
- pytest-rerunfailures
- pytest-xdist
- pytest<9.0
- python>=3.11,<3.15
- pyyaml>=6.0.0
Expand Down
1 change: 1 addition & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ dependencies:
- pytest<9.0
- pytest-cov
- pytest-rerunfailures
- pytest-xdist
test_python_cuopt:
common:
- output_types: [conda]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,13 @@ def _start_grpc_server_fixture(port_offset):
if server_bin is None:
pytest.skip("cuopt_grpc_server not found")

port = int(os.environ.get("CUOPT_TEST_PORT_BASE", "18000")) + port_offset
_worker = os.environ.get("PYTEST_XDIST_WORKER", "gw0")
worker_id = int(_worker[2:]) if _worker.startswith("gw") else 0
port = (
int(os.environ.get("CUOPT_TEST_PORT_BASE", "18000"))
+ port_offset
+ worker_id
)
proc = subprocess.Popen(
[server_bin, "--port", str(port), "--workers", "1"],
stdout=subprocess.DEVNULL,
Expand Down
1 change: 1 addition & 0 deletions python/cuopt/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ test = [
"numpy>=2.0,<3.0",
"pytest-cov",
"pytest-rerunfailures",
"pytest-xdist",
"pytest<9.0",
"rapids-logger==0.2.*,>=0.0.0a0",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
Expand Down
1 change: 1 addition & 0 deletions python/cuopt_self_hosted/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ classifiers = [
test = [
"pytest-cov",
"pytest-rerunfailures",
"pytest-xdist",
"pytest<9.0",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
mps = [
Expand Down
10 changes: 8 additions & 2 deletions python/cuopt_server/cuopt_server/tests/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
RAPIDS_DATASET_ROOT_DIR = os.path.join(RAPIDS_DATASET_ROOT_DIR, "datasets")


def _worker_port(base=5555):
_worker = os.environ.get("PYTEST_XDIST_WORKER", "gw0")
worker_id = int(_worker[2:]) if _worker.startswith("gw") else 0
return base + worker_id


def generate_json_data(**args):
return {arg[0]: arg[1] for arg in args.items() if arg[1] is not None}

Expand Down Expand Up @@ -345,7 +351,7 @@ def cuoptproc(request):
"-i",
"0.0.0.0",
"-p",
"5555",
str(_worker_port()),
"-l",
"debug",
]
Expand All @@ -359,7 +365,7 @@ def shutdown():


class RequestClient:
def __init__(self, port=5555):
def __init__(self, port=_worker_port()):
self.ip = "127.0.0.1"
self.port = port
self.url = f"http://{self.ip}:{self.port}"
Expand Down
1 change: 1 addition & 0 deletions python/cuopt_server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ test = [
"pexpect",
"pytest-cov",
"pytest-rerunfailures",
"pytest-xdist",
"pytest<9.0",
"requests",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
Expand Down