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

Make wait for released wait for the version to be active #8717

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

wouterdb
Copy link
Contributor

@wouterdb wouterdb commented Feb 7, 2025

Description

  1. I updated the wait for version fixture to wait for the version to be scheduled/active.
    • This makes the name a bit weird
    • But it makes it behave as it did prior to the scheduler
  2. I switched to the V2 endpoint, which reports the status in accordance to the new rules (updated in Make api endpoint to see which version is schedulled #8685)
  3. I did not update the V1 endpoint, which is now a bit weird/deceptive. I just don't see a good way of fixing it. Ideas welcome.

Self Check:

Strike through any lines that are not applicable (~~line~~) then check the box

  • Attached issue to pull request
  • Changelog entry
  • Type annotations are present
  • Code is clear and sufficiently documented
  • No (preventable) type errors (check using make mypy or make mypy-diff)
  • Sufficient test cases (reproduces the bug/tests the requested feature)
  • Correct, in line with design
  • End user documentation is included or an issue is created for end-user documentation (add ref to issue here: )
  • If this PR fixes a race condition in the test suite, also push the fix to the relevant stable branche(s) (see test-fixes for more info)

Copy link
Contributor

@Hugo-Inmanta Hugo-Inmanta left a comment

Choose a reason for hiding this comment

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

LGTM, what's the purpose of this change ? Was this causing race conditions somewhere ?

tests/utils.py Outdated
lookup = {
int(v["version"]): v["status"] == "active" for v in versions.result["data"]
}
return lookup[int(version)]
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 cast is redundant

Suggested change
return lookup[int(version)]
return lookup[version]

tests/utils.py Outdated
Comment on lines 331 to 334
lookup = {
int(v["version"]): v["status"] == "active" for v in versions.result["data"]
}
return lookup[int(version)]
Copy link
Contributor

Choose a reason for hiding this comment

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

The previous implementation covered the case where version doesn't exist yet. This one doesn't.

Suggested change
lookup = {
int(v["version"]): v["status"] == "active" for v in versions.result["data"]
}
return lookup[int(version)]
return any(v["status"] == "active" for v in versions.result["data"] if int(v["version"]) == version)

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

Successfully merging this pull request may close these issues.

3 participants