Merge ~vultaire/charm-hw-health:functest-fix into charm-hw-health:master

Proposed by Paul Goins
Status: Merged
Approved by: Paul Goins
Approved revision: 1fbfd15ca759d4429b822b359be493d73f393faa
Merged at revision: 7c50744a1a74534c053884619fcfafea40e3706a
Proposed branch: ~vultaire/charm-hw-health:functest-fix
Merge into: charm-hw-health:master
Diff against target: 13 lines (+1/-1)
1 file modified
src/tests/functional/test_hwhealth.py (+1/-1)
Reviewer Review Type Date Requested Status
Drew Freiberger (community) Approve
BootStack Reviewers Pending
Review via email: mp+389112@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Drew Freiberger (afreiberger) wrote :

I need to see your errors on this. This path works on focal....if asyncio changes between bionic and focal, we need to update the test requirements instead of changing this. I've hit it several many times and gotten useful info from it.

Revision history for this message
Paul Goins (vultaire) wrote :

It looks like the exception classes were relocated to asyncio.exceptions in Python 3.8 specifically. That reference unfortunately won't work in anything earlier.

However, it is available via asyncio.TimeoutError, which is what the docs specifically indicate should be used: https://docs.python.org/3.8/library/asyncio-exceptions.html#asyncio.TimeoutError

Revision history for this message
Drew Freiberger (afreiberger) wrote :

Thanks for the excellent explanation. I'd pulled the full path from the raised exception, but I see they're imported at the module level, so +1 for this fix. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/tests/functional/test_hwhealth.py b/src/tests/functional/test_hwhealth.py
2index d17aae7..e8d60b8 100644
3--- a/src/tests/functional/test_hwhealth.py
4+++ b/src/tests/functional/test_hwhealth.py
5@@ -224,7 +224,7 @@ async def test_checksum_forced_deploy(deploy_app, model, run_command):
6 ),
7 timeout=DEF_TIMEOUT,
8 )
9- except asyncio.exceptions.TimeoutError:
10+ except asyncio.TimeoutError:
11 print(
12 "failed to get expected state 'blocked:Tool megacli - checksum error', "
13 "witnessed '{}:{}'".format(

Subscribers

People subscribed via source and target branches

to all changes: