Repository navigation
test: run each conversion once, on a shared threaded worker - #41
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
conversion on a separate worker process.
Testing
Full test suite passes in about 17 s locally.