From c822b3246d88f7b000bbe27c5e53832fe7c830b2 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Sat, 3 Oct 2026 10:05:58 +0200 Subject: [PATCH] test(stateful): bound how far append grows an axis in the array lifecycle test `append` could add up to 4 rows every step with no upper bound, so over the nightly profile's 100 steps an array with chunks of 1 reached tens of thousands of chunks and each `matches_model` read took seconds. The 500 nightly examples together exceeded pytest's 600s faulthandler_timeout (563s on the last green nightly, killed on 2026-10-03). Cap appended extents at 2 * MAX_SIDE. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- tests/test_array_stateful.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_array_stateful.py b/tests/test_array_stateful.py index 3361d967e3..ca9b1d3ad8 100644 --- a/tests/test_array_stateful.py +++ b/tests/test_array_stateful.py @@ -50,6 +50,10 @@ DTYPE = np.dtype("int16") METADATA_KEYS = (".zarray", ".zattrs", "zarr.json") MAX_SIDE = 6 +# `append` may grow an axis past `MAX_SIDE`, but not without bound: with chunks of 1, +# the cells an extent of 100 steps could reach make each full-array read take seconds, +# and the nightly run of every example together exceeded pytest's faulthandler_timeout. +MAX_APPEND_EXTENT = 2 * MAX_SIDE async def _list(store: MemoryStore, prefix: str) -> list[str]: @@ -210,7 +214,8 @@ def append(self, data: st.DataObject) -> None: axes = st.sampled_from(self.legacy_axes) | axes axis = data.draw(axes, label="axis") block_shape = list(self.shape) - block_shape[axis] = data.draw(st.integers(0, 4), label="rows") + max_rows = min(4, max(0, MAX_APPEND_EXTENT - self.shape[axis])) + block_shape[axis] = data.draw(st.integers(0, max_rows), label="rows") block = data.draw(npst.arrays(DTYPE, tuple(block_shape)), label="block") note(f"append {block.shape} along {axis} to {self.shape}") if self.shape[axis] == 0 and block.shape[axis]: