Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
jankatins wants to merge2 commits intotestcontainers:main
base:main
Choose a base branch
Loading
fromjankatins:feat/add-RunFunctionWaitStrategy-and-use-it-in-pg

Conversation

@jankatins
Copy link
Contributor

@jankatinsjankatins commentedOct 18, 2025
edited
Loading

I found no way to convert the currentcontainer.exec() based check function to any of the currently existingWaitStartegies and so I addedRunFunctionWaitStrategy which can be used to convert suchcontainer.exec() based checks.

Helps with:#874
Closes:#883

@jankatinsjankatinsforce-pushed thefeat/add-RunFunctionWaitStrategy-and-use-it-in-pg branch fromb4ea0ee tod2b2200CompareOctober 18, 2025 15:15
result=self.func(container)
ifresult:
returnresult
excepttuple(self._transient_exceptions)ase:
Copy link
ContributorAuthor

@jankatinsjankatinsOct 18, 2025
edited
Loading

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")
Copy link
ContributorAuthor

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]
Copy link
ContributorAuthor

@jankatinsjankatinsOct 18, 2025
edited
Loading

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 :-(

@codecov
Copy link

codecovbot commentedOct 18, 2025
edited
Loading

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.25%. Comparing base (f608df9) to head (202c8f4).

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.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jankatinsjankatinsforce-pushed thefeat/add-RunFunctionWaitStrategy-and-use-it-in-pg branch 3 times, most recently from8c1e4f9 to531934aCompareOctober 18, 2025 22:11
This 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.
@jankatinsjankatinsforce-pushed thefeat/add-RunFunctionWaitStrategy-and-use-it-in-pg branch from394bc31 to202c8f4CompareNovember 3, 2025 21:00
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@jankatins

[8]ページ先頭

©2009-2025 Movatter.jp