TESTS: don't force rectilinear config true in the test#3909
TESTS: don't force rectilinear config true in the test#3909ianhi wants to merge 2 commits intozarr-developers:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3909 +/- ##
==========================================
- Coverage 93.08% 93.08% -0.01%
==========================================
Files 85 85
Lines 11230 11225 -5
==========================================
- Hits 10454 10449 -5
Misses 776 776
🚀 New features to boost your workflow:
|
| draw: st.DrawFn, *, shape: tuple[int, ...] | ||
| ) -> RegularChunkGridMetadata | RectilinearChunkGridMetadata: | ||
| """Generate either a RegularChunkGridMetadata or RectilinearChunkGridMetadata. | ||
| Depending on whether the config is set (WARN: look here if we get a flaky error) |
There was a problem hiding this comment.
That was all me - so any confusion is my fault.
This makes this strategy dependent on global state, i.e. a recipe for a flaky strategy down the line. I wanted to leave a note for the future in case that happens. Don't think I really hit the mark here though
There was a problem hiding this comment.
ok let's write in a longer comment then :)
There was a problem hiding this comment.
| Depending on whether the config is set (WARN: look here if we get a flaky error) | |
| This strategy depends on the global state of the config having rectilinear chunk grids enabled or not. | |
| This means that it may be a possible source of a hypothesis FlakyStrategy error due dependence | |
| on global state. However, in practice this seems unlikely to happen. |
|
i'm confused -- don't we want to turn on rectilinear chunks explicitly before this test? |
|
or is the idea to leave that detail to the configuration at test time |
|
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. |
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: zarr-python/tests/test_store/test_stateful.py Lines 21 to 25 in 2fbd30a |
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:
docs/user-guide/*.mdchanges/