Skip to content

test: fix race condition in test_sync_timeout - #4596

Merged
d-v-b merged 5 commits into
zarr-developers:mainfrom
sheikhayaan:fix-sync-timeout-race
Nov 6, 2026
Merged

d-v-b merged 5 commits into
zarr-developers:mainfrom
sheikhayaan:fix-sync-timeout-race

Conversation

@sheikhayaan

Copy link
Copy Markdown
Contributor

Fixes #4582.nnApplies the threading.Event patch suggested by @glaziermag. The old test raced a 2ms timeout against a 20ms sleep, which failed on macOS CI runners when the thread was rescheduled. Now the coroutine stays unfinished until the test has seen the timeout.nnTesting:n- pytest tests/test_sync.py: 19 passedn- test_sync_timeout run 50x in a loop: no failures

@github-actions github-actions Bot added the needs release notes Automatically applied to PRs which haven't added release notes label Nov 3, 2026
@github-actions github-actions Bot removed the needs release notes Automatically applied to PRs which haven't added release notes label Nov 3, 2026
@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.84%. Comparing base (9b82146) to head (212b956).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4596   +/-   ##
=======================================
  Coverage   94.84%   94.84%           
=======================================
  Files          96       96           
  Lines       13997    13997           
=======================================
  Hits        13275    13275           
  Misses        722      722           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@d-v-b

d-v-b commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

I removed the changelog fragment since this is an internal cleanup. the change looks good, thank you!

@github-actions github-actions Bot added the needs release notes Automatically applied to PRs which haven't added release notes label Nov 6, 2026
@d-v-b
d-v-b enabled auto-merge (squash) November 6, 2026 20:48
@d-v-b
d-v-b merged commit 1359014 into zarr-developers:main Nov 6, 2026
37 checks passed
barlowa124 pushed a commit to barlowa124/zarr-python that referenced this pull request Dec 4, 2026
* test: fix race condition in test_sync_timeout

* chore: add release notes for zarr-developers#4596

* chore: drop changelog fragment for test-only change

Assisted-by: ClaudeCode:claude-opus-5-5

---------

Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com>
barlowa124 pushed a commit to barlowa124/zarr-python that referenced this pull request Dec 4, 2026
* test: fix race condition in test_sync_timeout

* chore: add release notes for zarr-developers#4596

* chore: drop changelog fragment for test-only change

---------

Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs release notes Automatically applied to PRs which haven't added release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(test): test_sync_timeout races a 2 ms timeout against a 20 ms sleep — failed twice on main (macos-latest, py=3.12)

2 participants