Skip to content

Commit c163d9b

Browse files
bobbybobby
authored andcommitted
fix: Ensure single worker mode in CI tests
- Always pass --workers parameter to simunet command - Fix issue where NUM_WORKERS env var was ignored when = 1 - This caused CI tests to use auto-detected CPU cores instead of 1 - Remove redundant NUM_WORKERS from process environment This fixes the intermittent test failures in GitHub Actions where multi-worker mode was unexpectedly enabled, causing devices to be distributed across workers and making some devices unreachable. Fixes: #test_huawei_ce failures (R0010 errors) Made-with: Cursor
1 parent 9e8df0c commit c163d9b

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

tests/integration/conftest.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,17 @@ def simunet_process(request: pytest.FixtureRequest):
6262
num_workers = os.getenv("NUM_WORKERS", "1")
6363
logman.logger.info(f"Starting simunet process for integration tests (NUM_WORKERS={num_workers})...")
6464

65-
cmd = ["uv", "run", "simunet", "--no-reload"]
66-
if int(num_workers) > 1:
67-
cmd.extend(["--workers", num_workers])
65+
cmd = ["uv", "run", "simunet", "--no-reload", "--workers", num_workers]
6866

6967
process = subprocess.Popen(
7068
cmd,
7169
stdout=subprocess.PIPE,
7270
stderr=subprocess.PIPE,
73-
text=True,
74-
env={**os.environ, "NUM_WORKERS": num_workers}
71+
text=True
7572
)
7673

7774
# Wait for simunet to start up (give it more time for multi-worker mode)
78-
wait_time = 10 if int(num_workers) > 1 else 5
75+
wait_time = 15 if int(num_workers) > 1 else 5
7976
logman.logger.info(f"Waiting {wait_time}s for simunet to start up...")
8077
time.sleep(wait_time)
8178

0 commit comments

Comments
 (0)