Skip to content

Commit ee0943a

Browse files
committed
Use unique Netron port for each notebook xdist group
1 parent 308f885 commit ee0943a

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

tests/notebooks/test_jupyter_notebooks.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pytest
22

33
import nbformat
4+
import os
45
from nbconvert.preprocessors import ExecutePreprocessor
56

67
from finn.util.basic import get_finn_root
@@ -80,8 +81,16 @@
8081
@pytest.mark.parametrize(
8182
"notebook", basics_notebooks + advanced_notebooks + cyber_notebooks + bnn_notebooks
8283
)
83-
def test_notebook_exec(notebook):
84+
def test_notebook_exec(notebook, request):
8485
with open(notebook) as f:
86+
# Set different NETRON_PORT for each xdist group to avoid conflicts
87+
xdist_groups = ["notebooks_general", "notebooks_cybsec", "notebooks_cnv", "notebooks_tfc"]
88+
for mark in request.node.own_markers:
89+
if mark.name == "xdist_group":
90+
group = mark.kwargs["name"]
91+
os.environ["NETRON_PORT"] = str(8081 + xdist_groups.index(group))
92+
break
93+
8594
nb = nbformat.read(f, as_version=4)
8695
ep = ExecutePreprocessor(timeout=notebook_timeout_seconds, kernel_name="python3")
8796
try:

0 commit comments

Comments
 (0)