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

feat: new wait for idle #1245

Merged
merged 19 commits into from
Dec 20, 2024
Merged

Conversation

dimaqq
Copy link
Contributor

@dimaqq dimaqq commented Dec 19, 2024

Same as #1219 but using dumb classes instead of async generator.

@dimaqq dimaqq mentioned this pull request Dec 19, 2024
8 tasks
Copy link
Contributor

@james-garner-canonical james-garner-canonical left a comment

Choose a reason for hiding this comment

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

Thanks, it probably seems silly but this is significantly easier for me to follow. check and Loop.next look good to me.

I've commented on your FIXME note -- also a minor refactor suggestion to put the the error checking loops behind a raise_on_error flag (and likewise for blocked).

Also a few nitpicks on the tests just to do my due diligence, but I'm guessing you're fine with things as is. The most significant note is that it would probably be worth duplicating the check tests for blocked/errors to cover the "raise_on_{blocked,error}" = False cases (unless you've already covered that and I've just missed it).

juju/model/_idle.py Outdated Show resolved Hide resolved
juju/model/_idle.py Outdated Show resolved Hide resolved
tests/unit/test_idle_check.py Outdated Show resolved Hide resolved
tests/unit/test_idle_check.py Outdated Show resolved Hide resolved
tests/unit/test_idle_check.py Show resolved Hide resolved
tests/unit/test_idle_check.py Show resolved Hide resolved
tests/unit/test_idle_check.py Show resolved Hide resolved
tests/unit/test_idle_loop.py Show resolved Hide resolved
tests/unit/test_idle_loop.py Show resolved Hide resolved
tests/unit/test_model.py Show resolved Hide resolved
@james-garner-canonical
Copy link
Contributor

I notice there are a couple of failing integration tests (they all passed last run in #1219) -- related to this refactor, or just more test flakiness?

@dimaqq
Copy link
Contributor Author

dimaqq commented Dec 19, 2024

failed (quaranteed) integration test:

juju.errors.JujuError: refreshing charm "ch:amd64/focal/hello-juju-8": unexpected content-type from server "text/html"

and stable integration test:

Post "https://api.charmhub.io/v2/charms/refresh": net/http: TLS handshake timeout

looks like charmhub had a glitch, restarted.

@dimaqq
Copy link
Contributor Author

dimaqq commented Dec 19, 2024

@dimaqq
Copy link
Contributor Author

dimaqq commented Dec 19, 2024

@james-garner-canonical I've implemented most suggestions, pelase review :)

Copy link
Contributor

@james-garner-canonical james-garner-canonical left a comment

Choose a reason for hiding this comment

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

Looks great! Real charm CI runs are reassuring too.

Interesting how this charm tests run has two timeouts with old wait for idle in test_upgrade_from_edge (3.4/stable on focal and jammy) -- which both passed with new wait for idle. Since it's a timeout I guess this could be a flaky test generally, but I do wonder if this indicates something -- was old wait for idle more eager to bail out with a timeout error rather than check everything? I don't think this necessarily needs further investigation right now, just noting it

@dimaqq dimaqq changed the title Feat new wait for idle dumb class feat: new wait for idle Dec 20, 2024
@dimaqq
Copy link
Contributor Author

dimaqq commented Dec 20, 2024

/merge

@jujubot jujubot merged commit e0199c8 into juju:main Dec 20, 2024
28 of 29 checks passed
@dimaqq dimaqq deleted the feat-new-wait-for-idle--dumb-class branch December 20, 2024 01:02
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