Skip to content

test: run each conversion once, on a shared threaded worker - #41

Merged
yuriyzubov merged 11 commits into
mainfrom
test/consolidate
Oct 28, 2026
Merged

yuriyzubov merged 11 commits into
mainfrom
test/consolidate

Conversation

@yuriyzubov

Copy link
Copy Markdown
Member

Summary

Make the test suite fast. Many tests ran their own conversion to check one
property, and each conversion started a new worker process. Now each source
format has one conversion that checks values and metadata together, and all
tests share one threaded worker.

Notes for reviewers

  • Threaded workers do not pickle tasks, so one smoke test still runs a
    conversion on a separate worker process.
  • The old format × shape tests used all-zero data; the new tests use random values.

Testing

Full test suite passes in about 17 s locally.

Workers run as threads in the pytest process, so a new worker needs no
new process and no imports. The client is created once per session.
The shared client uses threads, so tasks are not pickled. This test runs
one zarr v2 conversion on a separate worker process, as LSF runs do.
The all-zero chunk test already checks the full inverted output, so the
separate invert=True/False runs are not needed. invert=False is the
plain conversion, covered elsewhere.
Replaces four tiff tests in test_metadata.py that each ran their own
conversion to check one property.
The old matrix made its data with np.random.rand().astype(uint8), which
is all zeros. The new cases use random integers. .tif and .tiff take the
same code path, and 3D tiff is covered by test_tiff_to_zarr3.
Replaces the n5 tests in test_to_zarr.py, test_metadata.py and
test_source_axes.py. The source 'axes' differ from the config axes, so
the test also shows that the source axes win.
… in one conversion

Replaces the zarr v2 tests in test_to_zarr.py, test_metadata.py (now
empty, removed) and test_source_axes.py. test_source_axes.py keeps only
the fail-before-write checks.
@yuriyzubov
yuriyzubov merged commit 9267b6f into main Oct 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant