- Notifications
You must be signed in to change notification settings - Fork351
feat(core, postgres): Add RunFunctionWaitStrategy and use it in pg#908
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
b4ea0ee tod2b2200Compare| result=self.func(container) | ||
| ifresult: | ||
| returnresult | ||
| excepttuple(self._transient_exceptions)ase: |
jankatinsOct 18, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
I actually found no reason why this shouldn't be a tuple already onself -> might be an nice refactoring onWaitStrategy and where it's used.
| ] | ||
| ) | ||
| ifresult.exit_code: | ||
| raiseConnectionError("pg_isready is not ready yet") |
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.
I assume that thepg_isready is some missing change in an older commit. I haven't investigated more...
| returnreturns.pop(0) | ||
| strategy=RunFunctionWaitStrategy(func).with_poll_interval(0) | ||
| strategy.wait_until_ready(mock_container)# type: ignore[arg-type] |
jankatinsOct 18, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
For some reason mypy didn't like passing in the mock and I had to add the ignore despite other places in the same file not having this problem with mock. No idea why :-(
codecovbot commentedOct 18, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## main #908 +/- ##==========================================+ Coverage 79.78% 80.25% +0.46%========================================== Files 14 14 Lines 1182 1200 +18 Branches 184 186 +2 ==========================================+ Hits 943 963 +20+ Misses 197 195 -2 Partials 42 42 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8c1e4f9 to531934aCompareThis is usefull for converting old wait_container_is_readywhich use container.exec() to check for a condition to become True.
This gets rid of a annoying depcreation warning.
394bc31 to202c8f4Compare
Uh oh!
There was an error while loading.Please reload this page.
I found no way to convert the current
container.exec()based check function to any of the currently existingWaitStartegiesand so I addedRunFunctionWaitStrategywhich can be used to convert suchcontainer.exec()based checks.Helps with:#874
Closes:#883