test_config: use native tmp_path pytest fixture #328
Merged
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.
Fixes #42 (see https://github.com/ome/omero-py/runs/6574741655?check_suite_focus=true for the latest occurence of this bug)
The current
test_config
implementation makes use of the temporary file utility theomero.util.temp_files
module. This implementation is not thread safe when running the pytest in a distributed manner as the username ("runner") used for the based directory is the same for all workers.This creates a potential race condition when
from omero.util.temp_files import create_path
is invoked concurrently as multiple workers might attempt to useos.makedirs
to create the sameomero_runner
directory.This PR updates the test implementation to use pytest native tmp_path fixture. Each temporary directory should be unique within the scope of the test so there should be no conflict between workers.