Skip to content

Commit e2687e7

Browse files
Further testing for CI hanging
Signed-off-by: Albert van Houten <[email protected]>
1 parent 46d426d commit e2687e7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

library/tests/conftest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def fxt_accelerator(request: pytest.FixtureRequest) -> str:
364364
return request.config.getoption("--device", "gpu")
365365

366366

367-
@pytest.fixture(params=set(OTXTaskType))
367+
@pytest.fixture(params=sorted(set(OTXTaskType), key=lambda x: x.value))
368368
def fxt_task(request: pytest.FixtureRequest) -> OTXTaskType:
369369
return request.param
370370

@@ -500,7 +500,8 @@ def get_model_template_paths() -> dict[OTXTaskType, list[dict]]:
500500
from otx.backend.native.cli.utils import get_otx_root_path
501501

502502
template_dir = Path(get_otx_root_path()).parent.parent / "tests" / "assets" / "geti" / "model_configs"
503-
template_paths = template_dir.rglob("*.yaml")
503+
# Sort template paths for deterministic ordering across workers
504+
template_paths = sorted(template_dir.rglob("*.yaml"))
504505
template_dict = defaultdict(list)
505506

506507
for template_path in template_paths:
@@ -555,9 +556,10 @@ def pytest_generate_tests(metafunc):
555556

556557
params = []
557558
if task_name.lower() == "all":
559+
# Sort by task value for deterministic ordering
558560
params = [
559561
(task, entry["template_path"], entry["tiling"])
560-
for task, entries in template_dict.items()
562+
for task, entries in sorted(template_dict.items(), key=lambda x: x[0].value)
561563
for entry in entries
562564
]
563565
else:

0 commit comments

Comments
 (0)