Skip to content

Commit 3571409

Browse files
authored
Explicitly skip test_resume with tensorstore (#736)
1 parent 21bf87a commit 3571409

1 file changed

Lines changed: 16 additions & 19 deletions

File tree

cubed/tests/test_executor_features.py

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import contextlib
21
import os
32
import platform
43
import re
@@ -21,6 +20,7 @@
2120
from cubed.diagnostics.tqdm import TqdmProgressBar
2221
from cubed.primitive.blockwise import apply_blockwise
2322
from cubed.runtime.create import create_executor
23+
from cubed.storage.backend import backend_storage_name
2424
from cubed.tests.utils import (
2525
ALL_EXECUTORS,
2626
MAIN_EXECUTORS,
@@ -190,6 +190,10 @@ def func(a):
190190
b.compute(executor=executor, callbacks=[mem_warn])
191191

192192

193+
@pytest.mark.skipif(
194+
backend_storage_name() == "tensorstore",
195+
reason="tensorstore does not support resume",
196+
)
193197
def test_resume(spec, executor):
194198
if executor.name == "beam":
195199
pytest.skip(f"{executor.name} executor does not support resume")
@@ -207,24 +211,17 @@ def test_resume(spec, executor):
207211
num_created_arrays = 1 # c
208212
assert task_counter.value == num_created_arrays + 4
209213

210-
if not hasattr(c.zarray, "nchunks_initialized"):
211-
# We expect resume to fail if there is no 'nchunks_initialized' property on the Zarr array
212-
cm = pytest.raises(NotImplementedError)
213-
else:
214-
cm = contextlib.nullcontext()
215-
216-
with cm:
217-
# since c has already been computed, when computing d only 4 tasks are run, instead of 8
218-
task_counter = TaskCounter()
219-
d.compute(
220-
executor=executor,
221-
callbacks=[task_counter],
222-
optimize_graph=False,
223-
resume=True,
224-
)
225-
# the create arrays tasks are run again, even though they exist
226-
num_created_arrays = 2 # c, d
227-
assert task_counter.value == num_created_arrays + 4
214+
# since c has already been computed, when computing d only 4 tasks are run, instead of 8
215+
task_counter = TaskCounter()
216+
d.compute(
217+
executor=executor,
218+
callbacks=[task_counter],
219+
optimize_graph=False,
220+
resume=True,
221+
)
222+
# the create arrays tasks are run again, even though they exist
223+
num_created_arrays = 2 # c, d
224+
assert task_counter.value == num_created_arrays + 4
228225

229226

230227
@pytest.mark.parametrize("compute_arrays_in_parallel", [True, False])

0 commit comments

Comments
 (0)