Merge ~medicalwei/plainbox-provider-checkbox:systemd-analyze-wait-for-boot into plainbox-provider-checkbox:master

Proposed by Yao Wei
Status: Merged
Approved by: Jonathan Cave
Approved revision: c19d201a752f31095bc240636ab066b18736e3de
Merged at revision: cc3a56610889c745cdab0f8be9576918ea90a0d5
Proposed branch: ~medicalwei/plainbox-provider-checkbox:systemd-analyze-wait-for-boot
Merge into: plainbox-provider-checkbox:master
Diff against target: 17 lines (+5/-1)
1 file modified
units/info/jobs.pxu (+5/-1)
Reviewer Review Type Date Requested Status
Jonathan Cave (community) Approve
jeremyszu (community) Approve
Sylvain Pineau Pending
Review via email: mp+407881@code.launchpad.net

Description of the change

This fixes LP: #1933901, by waiting for systemd to complete boot before running systemd-analyze.

Our tools might run checkbox tests too early, that when running systemd-analyze, systemd has not complete booting. Therefore we need to wait for the boot to complete before running systemd-analyze.

To post a comment you must log in.
Revision history for this message
jeremyszu (os369510) wrote :
review: Needs Information
Revision history for this message
Yao Wei (medicalwei) wrote (last edit ):

> How if system meets this issue?
> https://bugs.launchpad.net/plainbox-provider-checkbox/+bug/1910516

With `systemctl is-systemd-running`, the result may return "degraded" and exit. We just wait for the startup to finish and disregard the result.

Revision history for this message
jeremyszu (os369510) wrote :

@Wei,

thanks, LGTM.

Let's waiting for p-p-c maintainers' review.

review: Approve
Revision history for this message
Jonathan Cave (jocave) wrote :

Agree that the above needs to be handled and also some kind of general timeout to avoid blocking test runs completely.

review: Needs Fixing
Revision history for this message
Yao Wei (medicalwei) wrote (last edit ):

> Agree that the above needs to be handled and also some kind of general timeout
> to avoid blocking test runs completely.

Added a 60s general timeout. systemd-analyze runs after finishing bootup (either successfully "running" or with error "degraded"), or timeout occurs.

Revision history for this message
Rex Tsai (chihchun) wrote :

@jocave why don't we handle the general timeout from checkbox framework? There are many reason that block a test job to finish (eg, blocked by IO or driver).

I feel like checkbox should have a field to assign timeout, and let checkbox kill the job after timeout. but not handle the timeout in the implementation of the job

Revision history for this message
Jonathan Cave (jocave) wrote :

@Rex it's do-able of course, but unlikely to happen as quickly as modifying the job

Revision history for this message
Jonathan Cave (jocave) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/units/info/jobs.pxu b/units/info/jobs.pxu
2index d2ed96b..12d7ab1 100644
3--- a/units/info/jobs.pxu
4+++ b/units/info/jobs.pxu
5@@ -454,7 +454,11 @@ category_id: com.canonical.plainbox::info
6 id: info/systemd-analyze
7 estimated_duration: 0.2
8 _summary: System boot-up performance statistics
9-command: systemd-analyze
10+command:
11+ # Wait for boot to complete
12+ # https://github.com/systemd/systemd/pull/9796
13+ timeout 60 systemctl is-system-running --wait > /dev/null
14+ systemd-analyze
15
16 id: lstopo_verbose_attachment
17 plugin: attachment

Subscribers

People subscribed via source and target branches