Speed up and restore sync and upload_dir integration tests - #132
Merged
Merged
Conversation
- Wait for assets to be indexed instead of sleeping for fixed periods. `_wait_for_cld_files` polls Search until the folder has the expected number of assets, and fails with a clear message on timeout. - Run all `TestCLISync` tests again: `@retry_assertion` now works with and without parentheses and runs `tearDown` and `setUp` between tries. - Clean up dynamic folders with Search, and fall back to the Admin API when some assets are not indexed yet. - `sync` prints "Done!" after uploading or downloading files. - Update the expected log line for a missing local folder. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
Makes the
syncandupload_dirintegration tests wait for assets instead of sleeping, and runs all ofTestCLISyncagain.Brief Summary of Changes
_wait_for_cld_files(test/test_modules/test_cli_sync.py): polls Search every 0.5s until the folder has the expected number of assets and exists (or is gone), and fails with the expected and found values after 15s. Used insetUpand after_upload_sync_files, replacing the fixedtime.sleepcalls andGRACE_PERIOD.TestCLIUploadDir: removes the 1s sleeps insetUpandtearDown.retry_assertion(test/helper_test.py): works as@retry_assertionand@retry_assertion(...), and runstearDownandsetUpbetween tries. The 9 decorated tests inTestCLISyncnow run their bodies.delete_cld_folder_if_existsin dynamic folder mode: deletes the assets found with Search, and lists them with the Admin API, folder by folder, whendelete_folderreports that the folder is not empty.SyncDir.pushandSyncDir.pullreturnTrueafter transferring files, sosyncprints "Done!" in that case too.test_cli_sync_duplicate_file_names_dynamic_folder_mode: expects the current "Local folder ... does not exist." log line.What does this PR address?
Are tests included?
Reviewer, please note:
test_cli_sync.pytakes longer than onmaster, because the 9 restored tests now upload and sync files. Tests that already ran are 3–6s faster each.Checklist:
Ran
test_cli_sync.pyandtest_cli_upload_dir.pyagainst a test cloud in dynamic folder mode: 31 of 32 passed. The remaining test passed on its own after updating its expected log line. Fixed folder mode is covered by CI only.🤖 Generated with Claude Code