Skip to content

TESTS: don't force rectilinear config true in the test#3909

Open
ianhi wants to merge 4 commits intozarr-developers:mainfrom
ianhi:ian/stateful-chunks
Open

TESTS: don't force rectilinear config true in the test#3909
ianhi wants to merge 4 commits intozarr-developers:mainfrom
ianhi:ian/stateful-chunks

Conversation

@ianhi
Copy link
Copy Markdown
Contributor

@ianhi ianhi commented Apr 15, 2026

The new array strategy for stateful testing was ignoring the config setting and forcibly changing it - which gives no way for a downstream consumer to opt of out. This makes it respect the config. There is a small worry that now one of our strategies depends on a global state (potential cause of flakyiness) but I'm not really sure there's a clean way around that.

@dcherian

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)

@github-actions github-actions bot added the needs release notes Automatically applied to PRs which haven't added release notes label Apr 15, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.10%. Comparing base (520344a) to head (1fd3335).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3909      +/-   ##
==========================================
- Coverage   93.11%   93.10%   -0.01%     
==========================================
  Files          85       85              
  Lines       11221    11216       -5     
==========================================
- Hits        10448    10443       -5     
  Misses        773      773              
Files with missing lines Coverage Δ
src/zarr/testing/strategies.py 92.91% <100.00%> (-0.13%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/zarr/testing/strategies.py Outdated
@d-v-b
Copy link
Copy Markdown
Contributor

d-v-b commented Apr 15, 2026

i'm confused -- don't we want to turn on rectilinear chunks explicitly before this test?

@d-v-b
Copy link
Copy Markdown
Contributor

d-v-b commented Apr 15, 2026

or is the idea to leave that detail to the configuration at test time

@d-v-b
Copy link
Copy Markdown
Contributor

d-v-b commented Apr 15, 2026

also... we should rethink putting the config check inside the chunk grid class itself. If someone wants to import the class and construct it, that should be allowed.

@ianhi
Copy link
Copy Markdown
Contributor Author

ianhi commented Apr 15, 2026

i'm confused -- don't we want to turn on rectilinear chunks explicitly before this test?

Yes for the zarr-python tests, but not within the the strategy. The strategy is public API and might be run on a system that doesn't support rectilinear chunks. For example icechunk format 1 just straight up doesn't support it, so I need to be able to turn it off via the config and have that be respected.

In the actual zarr-python stateful tests it gets turned on by default:

@pytest.fixture(autouse=True)
def _enable_rectilinear_chunks() -> Generator[None, None, None]:
"""Enable rectilinear chunks since strategies may generate them."""
with zarr.config.set({"array.rectilinear_chunks": True}):
yield

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.

3 participants