GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(core, postgres): Add RunFunctionWaitStrategy and use it in pg by jankatins · Pull Request #908 · testcontainers/testcontainers-python Conversation
|
| result = self.func(container) | ||
| if result: | ||
| return result | ||
| except tuple(self._transient_exceptions) as e: |
There was an error while loading. Please reload this page.
There was a problem 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 on self -> might be an nice refactoring on WaitStrategy and where it's used.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ] | ||
| ) | ||
| if result.exit_code: | ||
| raise ConnectionError("pg_isready is not ready yet") |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I assume that the pg_isready is some missing change in an older commit. I haven't investigated more...
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| return returns.pop(0) | ||
|
|
||
| strategy = RunFunctionWaitStrategy(func).with_poll_interval(0) | ||
| strategy.wait_until_ready(mock_container) # type: ignore[arg-type] |
There was an error while loading. Please reload this page.
There was a problem 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 :-(
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
8c1e4f9 to
531934a
Compare
This is usefull for converting old wait_container_is_ready which use container.exec() to check for a condition to become True.
This gets rid of a annoying depcreation warning.
394bc31 to
202c8f4
Compare
|
I guess this can be closed after #935 was merged? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.