Fix sandbox multiprocessing test on Python 3.14

This commit is contained in:
Codex + Matthew Zeng
2026-01-16 12:30:50 -08:00
committed by Matthew Zeng
parent e893e83eb9
commit 6084fcf0f3

View File

@@ -77,8 +77,17 @@ async fn python_multiprocessing_lock_works_under_sandbox() {
};
let python_code = r#"import multiprocessing
import sys
from multiprocessing import Lock, Process
# Python 3.14 defaults to forkserver on some Linux distros, which can
# be blocked by the sandbox. Force fork to keep the test stable.
if sys.platform.startswith("linux"):
try:
multiprocessing.set_start_method("fork")
except RuntimeError:
pass
def f(lock):
with lock:
print("Lock acquired in child process")