Skip to content

test: ignore Python 3.15 fork-with-threads DeprecationWarning in test_multiprocessing#4143

Merged
d-v-b merged 2 commits into
zarr-developers:mainfrom
d-v-b:claude/zarr-python-4086-8cc808
Jul 13, 2026
Merged

test: ignore Python 3.15 fork-with-threads DeprecationWarning in test_multiprocessing#4143
d-v-b merged 2 commits into
zarr-developers:mainfrom
d-v-b:claude/zarr-python-4086-8cc808

Conversation

@d-v-b

@d-v-b d-v-b commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

I got claude to fix #4086 by selectively ignoring the warning, because forking with threads is safe for zarr-python due to our use of a fork handler, and we will keep testing against it until python fully drops support. Claude's text is below

🤖 AI text below 🤖

Fixes #4086

Python 3.15 makes os.fork() emit a DeprecationWarning when the process has multiple threads (python/cpython#84559). zarr's sync event-loop thread is always running by the time test_multiprocessing forks, and the suite runs with filterwarnings = ["error"], so the fork parametrizations fail on 3.15. Fork-safety despite those threads is exactly what this test pins down (zarr registers an os.register_at_fork handler), so keep the coverage and ignore the warning with a targeted per-param filter.

Fixes #4086

Assisted-by: ClaudeCode:claude-fable-5

Summary

[Describe what this PR changes and why, in your own words.]

For reviewers

[What would you most value a second look at? What are you already confident in? For a refactor, say whether behavior is meant to be unchanged.]

Author attestation

  • I am a human, these are my changes, and I have reviewed and understood every change and can explain why each is correct.

AI coding assistance is welcome, but a human must be the author and is responsible for the contents of the PR. The description and any review responses must be in your own words. Please read AI-assisted contributions before opening.

TODO

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/user-guide/*.md
  • Changes documented as a new file in changes/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

d-v-b added 2 commits July 13, 2026 18:00
…_multiprocessing

Python 3.15 makes os.fork() emit a DeprecationWarning when the process
has multiple threads (python/cpython#84559). zarr's sync event-loop
thread is always running by the time test_multiprocessing forks, and the
suite runs with filterwarnings = ["error"], so the fork parametrizations
fail on 3.15. Fork-safety despite those threads is exactly what this
test pins down (zarr registers an os.register_at_fork handler), so keep
the coverage and ignore the warning with a targeted per-param filter.

Fixes zarr-developers#4086

Assisted-by: ClaudeCode:claude-fable-5
@d-v-b

d-v-b commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

this is a minor change to our tests. self-merging.

@d-v-b d-v-b merged commit a75add9 into zarr-developers:main Jul 13, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_multiprocessing[fork] fails on Python 3.15

1 participant