Skip to content

Commit 74bbc04

Browse files
committed
Add "In a nutshell" comment, in response to request by @EricCousineau-TRI
1 parent 29cea64 commit 74bbc04

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/conftest.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@
1818
import pybind11_tests
1919

2020
if os.name != "nt":
21-
# https://github.com/pybind/pybind11/issues/4105#issuecomment-1301004592
21+
# Full background: https://github.com/pybind/pybind11/issues/4105#issuecomment-1301004592
22+
# In a nutshell: fork() after starting threads == flakiness in the form of deadlocks.
23+
# It is actually a well-known pitfall, unfortunately without guard rails.
24+
# "forkserver" is more performant than "spawn" (~9s vs ~13s for tests/test_gil_scoped.py,
25+
# visit the issuecomment link above for details).
26+
# Windows does not have fork() and the associated pitfall, therefore it is best left
27+
# running with defaults.
2228
multiprocessing.set_start_method("forkserver")
2329

2430
_long_marker = re.compile(r"([0-9])L")

0 commit comments

Comments
 (0)