-
Notifications
You must be signed in to change notification settings - Fork 51
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
Use the retry decorator in WiFi tests (Bugfix) #1488
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1488 +/- ##
==========================================
+ Coverage 47.48% 47.50% +0.01%
==========================================
Files 369 369
Lines 39586 39549 -37
Branches 6685 6678 -7
==========================================
- Hits 18798 18788 -10
+ Misses 20077 20050 -27
Partials 711 711
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This helps investigating issues when more than one functions are using the retry decorator.
Both function are doing exactly the same thing, the only difference being the command used. Create a connection() function, and call it from open_connection() and secured_connection(). Compared to the previous implementation, the connection() function is more linear and does not rely on boolean return codes to decide what to do. Instead, it's trying to do things and expect exceptions to be raised in case of problem (this is why it's using subprocess.run(..., check=True) for instance)
Parts of the wifi_nmcli_test.py script was implementing a basic retry mechanism. Remove this to use the retry decorator instead. In addition, raise exceptions rather than trying to catching them, or using boolean return codes.
This is to avoid waiting for the actual retry decorator implementation.
1519956
to
3f52db9
Compare
Testing this on 3 devices in the lab (focal, jammy, noble): https://github.com/canonical/checkbox/actions/runs/10958861773 For reference, here is the command:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM +1, consider a few small changes here and there
Co-authored-by: Massimiliano <[email protected]>
Description
The main raisons d'être of this PR are:
wifi_nmcli_test.py
script. This is done to prevent an often seen failure in the lab where the usual answer is to rerun the whole test plan. Now, the WiFi test retries up to 5 times, adding a delay between each retry.Resolved issues
CHECKBOX-1543
Documentation
Nothing is modified in terms of Checkbox jobs or external-facing documentation.
Tests