Skip to content

Commit 9e2776d

Browse files
committed
Prevent deadlocks by using spawn
1 parent 76bac29 commit 9e2776d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/integration/test_images.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from concurrent.futures import ProcessPoolExecutor, as_completed
33
from contextlib import redirect_stderr, redirect_stdout
44
from io import StringIO
5+
from multiprocessing import get_context
56
from typing import Dict, List
67

78
from tests.integration.image_checker import (
@@ -230,7 +231,9 @@ def test_images():
230231
# Run tests in parallel using ProcessPoolExecutor for isolated stdout/stderr
231232
print(f"Running {len(test_configs)} tests in parallel")
232233
print("Individual test logs will be written to test_<name>.log files")
233-
with ProcessPoolExecutor(max_workers=6) as executor:
234+
with ProcessPoolExecutor(
235+
max_workers=6, mp_context=get_context("spawn")
236+
) as executor:
234237
# Submit all tests
235238
future_to_test = {
236239
executor.submit(run_test, *config): config[0] for config in test_configs

0 commit comments

Comments
 (0)