From 61d78d7c9d710985b8ab7afbf7bbd98f035f7264 Mon Sep 17 00:00:00 2001 From: Tom White Date: Thu, 26 Jun 2025 11:43:58 +0100 Subject: [PATCH] Explicitly skip test_resume with tensorstore --- cubed/tests/test_executor_features.py | 35 ++++++++++++--------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/cubed/tests/test_executor_features.py b/cubed/tests/test_executor_features.py index e5de4cacd..22d0045bb 100644 --- a/cubed/tests/test_executor_features.py +++ b/cubed/tests/test_executor_features.py @@ -1,4 +1,3 @@ -import contextlib import os import platform import re @@ -21,6 +20,7 @@ from cubed.diagnostics.tqdm import TqdmProgressBar from cubed.primitive.blockwise import apply_blockwise from cubed.runtime.create import create_executor +from cubed.storage.backend import backend_storage_name from cubed.tests.utils import ( ALL_EXECUTORS, MAIN_EXECUTORS, @@ -190,6 +190,10 @@ def func(a): b.compute(executor=executor, callbacks=[mem_warn]) +@pytest.mark.skipif( + backend_storage_name() == "tensorstore", + reason="tensorstore does not support resume", +) def test_resume(spec, executor): if executor.name == "beam": pytest.skip(f"{executor.name} executor does not support resume") @@ -207,24 +211,17 @@ def test_resume(spec, executor): num_created_arrays = 1 # c assert task_counter.value == num_created_arrays + 4 - if not hasattr(c.zarray, "nchunks_initialized"): - # We expect resume to fail if there is no 'nchunks_initialized' property on the Zarr array - cm = pytest.raises(NotImplementedError) - else: - cm = contextlib.nullcontext() - - with cm: - # since c has already been computed, when computing d only 4 tasks are run, instead of 8 - task_counter = TaskCounter() - d.compute( - executor=executor, - callbacks=[task_counter], - optimize_graph=False, - resume=True, - ) - # the create arrays tasks are run again, even though they exist - num_created_arrays = 2 # c, d - assert task_counter.value == num_created_arrays + 4 + # since c has already been computed, when computing d only 4 tasks are run, instead of 8 + task_counter = TaskCounter() + d.compute( + executor=executor, + callbacks=[task_counter], + optimize_graph=False, + resume=True, + ) + # the create arrays tasks are run again, even though they exist + num_created_arrays = 2 # c, d + assert task_counter.value == num_created_arrays + 4 @pytest.mark.parametrize("compute_arrays_in_parallel", [True, False])