Conversation
Adding `set -eo pipefail` in the snapd refresh/revert jobs that initiate a reboot ensures that: - any failure in the `snap_update_test.py` is not masked by the pipe command (this is achieved by `set -o pipefail`) - any failure at any step of the `command:` field just fails the whole job (this is ensured by `set -e`). This is important to avoid the `reboot` command from being issued if something goes wrong in the script. Fix #1615
Some devices in our test lab are really slow to download and apply snap updates. Increase timeout from 5 minutes to 10 minutes to hopefully help with this.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1616 +/- ##
==========================================
+ Coverage 48.29% 48.44% +0.14%
==========================================
Files 372 368 -4
Lines 40075 39880 -195
Branches 6758 6739 -19
==========================================
- Hits 19356 19318 -38
+ Misses 20002 19847 -155
+ Partials 717 715 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hook25
left a comment
There was a problem hiding this comment.
Please confirm that noreturn will actually terminate when a job fails
Unfortunately you're right, a |
|
You can try to use |
…mmand When running a snapd revert or refresh command, a SnapdRequestError exception might be raised (for example when the refresh command failed to run within the given time). If this is the case, the script fails, and if it is executed as part of a Checkbox run, a `__result` file is generated and stored in the shared session directory to record the fact that this job failed. When the session is resumed, Checkbox will automatically resume the session and mark this test as failed.
|
I've side-loaded the provider on the same device that exhibited the original problem, and the jobs seem to pass now: |
This exception can also be raised when calling snap commands using checkbox_support.snap_utils.snapd.Snapd.
|
I've modified the script to timeout much earlier (a few seconds instead of 10 minutes) just to trigger some exceptions. I noticed another exception needed to be caught in order to apply the trick using I ran the modified script on the same device, and when the session is auto-resumed, the kernel refresh job is automatically marked as failed as expected (this is an abstract from the raw session: |
Co-authored-by: Massimiliano <massimiliano.girardi@canonical.com>
Description
Adding
set -eo pipefailin the snapd refresh/revert jobs that initiatea reboot ensures that:
snap_update_test.pyis not masked by the pipecommand (this is achieved by
set -o pipefail)__resultfile in the session sharing directory) and raise an exception. This will not prevent the job from rebooting, but when resuming, the job will be marked as failed.Minor: increase timeout to 10 minutes to try to limit the number of issues on slow devices.
Resolved issues
Documentation
Tests