stress/cpu_stress_ng_test hangs if the device tries to suspend

Bug #1815867 reported by Pierre Equoy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox Provider - Base
Fix Released
Medium
Sylvain Pineau

Bug Description

While testing two somerville platforms, I noticed the stress/cpu_stress_ng_test job would hang if the device's suspend feature was not deactivated beforehands. Talking with Jerry, it seems that it's a known issue, so testers always manually deactivate suspend before stress/cpu_stress_ng_test is started.

To reproduce:

1. On a device with suspend activated (Settings > Power > Automatic Suspend), start stress/cpu_stress_ng_test.
2. At the period set in the Automatic Suspend screen, the device tries to suspend.
3. From now on, the CPU stress test seems like it's running, but it will never complete and Checkbox cannot finish the testing session.

Workaround: Make sure Settings > Power > Automatic Suspend is set to OFF.

A solution could be to automatically deactivate suspend before starting this test, and automatically reactivate it after the test is finished, using those commands (see <https://askubuntu.com/a/651437>):

# Deactivate suspend
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type nothing
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type nothing

# Reactivate suspend
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type suspend
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type suspend

It seems this issue only appear with stress/cpu_stress_ng_test, so it might be possible to just add those commands into the job itself. Otherwise, we could create two new jobs and, using the `depends` flag, make sure stress/cpu_stress_ng_test is sandwiched between them.

I'm not sure how this would work on the server side, though...

Related branches

Pierre Equoy (pieq)
Changed in plainbox-provider-checkbox:
importance: Undecided → Medium
Jerry Kao (jerry.kao)
Changed in plainbox-provider-checkbox:
assignee: nobody → Sylvain Pineau (sylvain-pineau)
importance: Medium → High
tags: added: ce-qa-concern
Changed in plainbox-provider-checkbox:
milestone: none → 0.50.0
assignee: Sylvain Pineau (sylvain-pineau) → nobody
Changed in plainbox-provider-checkbox:
assignee: nobody → Jonathan Cave (jocave)
Jonathan Cave (jocave)
Changed in plainbox-provider-checkbox:
status: New → In Progress
Jonathan Cave (jocave)
Changed in plainbox-provider-checkbox:
status: In Progress → Confirmed
assignee: Jonathan Cave (jocave) → nobody
Changed in plainbox-provider-checkbox:
importance: High → Medium
milestone: 0.50.0 → none
Revision history for this message
Rex Tsai (chihchun) wrote :

I would suggest to use inhibit API[1] to suppress the suspend with the user session, so the test script would not mess around the user settings. The inhibit API should only apply to the machine that are running Desktop.

Since the session is running under the specific Xorg instance. The checkbox should be aware of the DISPLAY environment and pass it to each test job. The dbus-launch command will create yet another user session, which is not something you want to do.

Since the cpustress test can be used on both core and Desktop, I think it's better to have the inhibit as it's own job, and only apply to the desktop environment.

[1] https://github.com/GNOME/gnome-settings-daemon/blob/GNOME_SETTINGS_DAEMON_3_28_0/gnome-settings-daemon/org.gnome.SessionManager.xml#L102

Changed in plainbox-provider-checkbox:
assignee: nobody → Sylvain Pineau (sylvain-pineau)
milestone: none → 0.56.0
status: Confirmed → In Progress
Changed in plainbox-provider-checkbox:
status: In Progress → Fix Committed
Revision history for this message
Pierre Equoy (pieq) wrote :

Tested on Checkbox RC stack:

checkbox-ng: 1.12.0rc1
checkbox-support: 0.49.0rc1
com.canonical.ce:oem: 1.0
certification-client: 0.44.0rc1
plainbox-provider-checkbox: 0.56.0rc1
plainbox-provider-resource-generic: 0.47.0rc1
plainbox-provider-tpm2: 1.15.0rc1

1. Setup suspend after 15 minutes (Settings > Power > Automatic Suspend)
2. Setup a checkbox launcher with the following section:

    [environment]
    STRESS_NG_CPU_TIME = 1200

This is to run the CPU stress tests for 20 minutes (1200 seconds)

3. Run the CPU stress tests (stress/cpu_stress_ng_test)

Shortly before 15 minutes are passed, a popup "The device will suspend soon" is displayed, but the device does *not* go into suspend, and the CPU stress test can end normally.

-> OK!

tags: added: cqa-verify
Changed in plainbox-provider-checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.