-
Notifications
You must be signed in to change notification settings - Fork 72
scylla_repository: cache setups #667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, didn't know '@cache' is the same as '@lru_cache'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces caching for repository setup functions to prevent repeated S3 downloads during a single test session.
- Added
@cachedecorator tosetupin bothscylla_repository.pyandrepository.py - Imported
functools.cacheto enable caching - Ensures each setup call with the same parameters runs only once per test session
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ccmlib/scylla_repository.py | Imported cache and applied @cache to setup and setup_scylla_manager |
| ccmlib/repository.py | Imported cache and applied @cache to setup |
Comments suppressed due to low confidence (3)
ccmlib/scylla_repository.py:226
- Add or update tests to verify that calling setup multiple times with identical parameters does not trigger additional downloads, ensuring the caching layer works correctly.
@cache
ccmlib/scylla_repository.py:13
- Ensure that functools.cache is supported in the project's minimum Python version; if not, consider using functools.lru_cache(maxsize=None) for backward compatibility.
from functools import cache
ccmlib/repository.py:16
- Verify that functools.cache is available for all supported Python versions; if backward compatibility is needed, prefer functools.lru_cache(maxsize=None).
from functools import cache
It's been so only since python 3.9 And the CI test is still also for 3.8 :( |
If you change it to |
I know that, we still need to drop 3.8 support it's EOL |
f9f2abc to
15d7f1a
Compare
so we won't hit s3 urls on each start of a test (cause of multiple calls to `scylla_repository.setup()`) we gonna cache this call for the time of the test session on a new test session, those would be called only once
so we won't hit s3 urls on each start of a test (cause of multiple calls to
scylla_repository.setup())we gonna cache this call for the time of the test session
on a new test session, those would be called only once