Resolve test_convert_s3_path_sqlite test failures with explicit local_cache_dir #83
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.
Description
This PR seeks to address #81 where tests periodically fail with
test_convert_s3_path_sqlite
(see issue for greater specificity on the patterns associated). Initially I made the mistake of believing this was caused due to nested Pytest fixture behavior with temporary directories supplied to tests (see PR #79). This PR reverts those changes and adds different ones to prevent the same tests failures from persisting.I believe this test is failing due to Cloudpathlib's default temporary cache behavior (
"tmp_dir"
). Twoconvert
calls are made, both using the default temporary cache location to store the SQLite file locally. When the firstconvert
completes, the secondconvert
seems to begin the process of reading from the same cache location which seems to persist for a short time after the firstconvert
completes. Eventually, the temporary directory supplied from Cloudpathlib is removed while the secondconvert
is running. I hypothesize that tests only periodically fail due to how quickly they can generally run, with Python 3.8 (where the issue often occurs) missing performance improvements available to Python 3.9 and 3.10.Detection of the missing source data file has gone undetected due to a missing
raise
for DuckDB exceptions when extracting data. Araise
is added for these exceptions with #82 (where linting demonstrated a need through_get_table_columns_and_types
changes during development). A Github Actions job run which exhibits the error with araise
may be found here. Full logs are attached here here for later reference in case they're purged.After adding an explicit
local_cache_dir
value for these test runs ofconvert
within test_convert_s3_path_sqlite I no longer have witnessed the issue occurring.Thanks in advance for any thoughts and feedback on this PR!
What is the nature of your change?
Checklist
Please ensure that all boxes are checked before indicating that a pull request is ready for review.