diff --git a/changes/4086.misc.md b/changes/4086.misc.md new file mode 100644 index 0000000000..2564cf9ea1 --- /dev/null +++ b/changes/4086.misc.md @@ -0,0 +1 @@ +Fix `test_multiprocessing[fork]` failing on Python 3.15, where `os.fork()` in a multi-threaded process emits a `DeprecationWarning` that the test suite promotes to an error. diff --git a/tests/test_array.py b/tests/test_array.py index 4faf99eb9e..d2f324439d 100644 --- a/tests/test_array.py +++ b/tests/test_array.py @@ -1903,9 +1903,18 @@ def _index_array(arr: AnyArray, index: Any) -> Any: [ pytest.param( "fork", - marks=pytest.mark.skipif( - sys.platform in ("win32", "darwin"), reason="fork not supported on Windows or OSX" - ), + marks=[ + pytest.mark.skipif( + sys.platform in ("win32", "darwin"), + reason="fork not supported on Windows or OSX", + ), + # Python 3.15 deprecates fork() in multi-threaded processes, and zarr's + # sync event-loop thread is always running here. Fork-safety despite + # those threads is exactly what this test pins down, so keep running it. + pytest.mark.filterwarnings( + r"ignore:This process \(pid=\d+\) is multi-threaded, use of fork\(\):DeprecationWarning" + ), + ], ), "spawn", pytest.param(