Skip to content
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

Move _wait_until to a correct place #9962

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

xjules
Copy link
Contributor

@xjules xjules commented Feb 5, 2025

Issue
Utility function _wait_until is used only in a single test function, so moving it there.

Approach
🚗

(Screenshot of new behavior in GUI if applicable)

  • PR title captures the intent of the changes, and is fitting for release notes.
  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Make sure unit tests pass locally after every commit (git rebase -i main --exec 'just rapid-tests')

When applicable

  • When there are user facing changes: Updated documentation
  • New behavior or changes to existing untested code: Ensured that unit tests are added (See Ground Rules).
  • Large PR: Prepare changes in small commits for more convenient review
  • Bug fix: Add regression test for the bug
  • Bug fix: Create Backport PR to latest release

@xjules xjules self-assigned this Feb 5, 2025
Copy link

codspeed-hq bot commented Feb 5, 2025

CodSpeed Performance Report

Merging #9962 will not alter performance

Comparing xjules:mv_wait_until (281a354) with main (3982f5b)

Summary

✅ 25 untouched benchmarks

@xjules xjules force-pushed the mv_wait_until branch 5 times, most recently from c79398f to 05993bd Compare February 6, 2025 09:11
Comment on lines 310 to 315
def _wait_until(condition, timeout, fail_msg):
start = time.time()
while not condition():
assert start + timeout > time.time(), fail_msg
time.sleep(0.1)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is only used one place, do we need it as a separate function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe. Shall I refactor then?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would be good yes. while not condition() does not read too well without any typing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually there is another wait_until function. I will use that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready for Review
Development

Successfully merging this pull request may close these issues.

2 participants