Skip to content

Conversation

@snalvc
Copy link

@snalvc snalvc commented Oct 3, 2025

Description

Add test for checking thermald's adaptive engine startup by monitoring its output.

Resolved issues

SOMERVILLE-2442

Documentation

This test launches thermald with adaptive engine and uses grep to detect which pattern appears first:

  • SUCCESS: "Start main loop" - adaptive engine started correctly
  • FAILURE: "Also unable to evaluate any conditions" - adaptive engine failed,
    thermald falls back to highest power profile

The test captures the first occurrence of either pattern to determine if the adaptive engine initialization was successful.

Tests

Run on 202310-32268 (jellyfish-treecko)

(venv) ubuntu@ubuntu:~/checkbox$ thermald --version
2.5.6
(venv) ubuntu@ubuntu:~/checkbox$ checkbox-cli run com.canonical.certification::miscellanea/check-thermald-adaptive-engine
$PROVIDERPATH is defined, so following provider sources are ignored ['/usr/local/share/plainbox-providers-1', '/usr/share/plainbox-providers-1', '/home/ubuntu/.local/share/plainbox-providers-1', '/var/tmp/checkbox-providers-develop'] 
===========================[ Running Selected Jobs ]============================
=========[ Running job 1 / 4. Estimated time left (at least): 0:00:02 ]=========
---------------------[ Collect information about the CPU ]----------------------
ID: com.canonical.certification::cpuinfo
Category: com.canonical.certification::information_gathering

Outcome: job passed
=========[ Running job 3 / 4. Estimated time left (at least): 0:00:00 ]=========
------------------------[ Check if thermald is active ]-------------------------
ID: com.canonical.certification::miscellanea/thermald
Category: com.canonical.plainbox::miscellanea
... 8< -------------------------------------------------------------------------
<OMITTED>
------------------------------------------------------------------------- >8 ---
Outcome: job passed
=========[ Running job 4 / 4. Estimated time left (at least): 0:00:00 ]=========
-----[ Tests thermald's adaptive engine startup by monitoring its output. ]-----
ID: com.canonical.certification::miscellanea/check-thermald-adaptive-engine
Category: com.canonical.plainbox::miscellanea
... 8< -------------------------------------------------------------------------
2025-10-03 15:31:49 - INFO - === THERMALD ADAPTIVE ENGINE TEST ===
2025-10-03 15:31:49 - INFO - This test verifies that thermald's adaptive engine starts correctly.
2025-10-03 15:31:49 - INFO - Monitoring thermald output for adaptive engine initialization patterns...
2025-10-03 15:31:49 - INFO - Success pattern: 'Start main loop'
2025-10-03 15:31:49 - INFO - Failure pattern: 'Also unable to evaluate any conditions'
2025-10-03 15:31:49 - INFO - Command: thermald --no-daemon --loglevel=debug --adaptive
2025-10-03 15:31:49 - INFO - Timeout: 15 seconds
2025-10-03 15:31:49 - INFO - ======================================================================
2025-10-03 15:31:49 - INFO - --- Checking thermald systemd service ---
2025-10-03 15:31:49 - INFO - Thermald service is running. Stopping it...
2025-10-03 15:31:51 - INFO - Thermald service stopped successfully.
2025-10-03 15:31:51 - INFO - Started thermald with adaptive engine (PGID: 31317)
2025-10-03 15:31:51 - INFO - Started pattern monitoring (grep PID: 31318)
2025-10-03 15:31:51 - INFO - Waiting for adaptive engine initialization patterns...
2025-10-03 15:31:51 - INFO - --- Cleaning up test processes ---
2025-10-03 15:31:51 - INFO - Sending SIGTERM to thermald process group 31317...
2025-10-03 15:31:53 - INFO - Thermald process group terminated gracefully.
2025-10-03 15:31:53 - INFO - --- Restarting thermald systemd service ---
2025-10-03 15:31:53 - INFO - Thermald service restarted successfully.
2025-10-03 15:31:53 - INFO - ======================================================================
2025-10-03 15:31:53 - INFO - === THERMALD ADAPTIVE ENGINE TEST RESULT ===
2025-10-03 15:31:53 - INFO - SUCCESS: Thermald adaptive engine started correctly.
Found success pattern - adaptive engine is active.
2025-10-03 15:31:53 - INFO - PASSED: Thermald adaptive engine is working correctly.
2025-10-03 15:31:53 - INFO - ======================================================================
------------------------------------------------------------------------- >8 ---
Outcome: job passed
Finalizing session that hasn't been submitted anywhere: checkbox-run-2025-10-03T07.31.48
==================================[ Results ]===================================
 ☑ : Collect information about the CPU
 ☑ : Collect information about installed software packages
 ☑ : Check if thermald is active
 ☑ : Tests thermald's adaptive engine startup by monitoring its output.
(venv) ubuntu@ubuntu:~/checkbox$ thermald --version
2.4.9
(venv) ubuntu@ubuntu:~/checkbox$ checkbox-cli run com.canonical.certification::miscellanea/check-thermald-adaptive-engine
$PROVIDERPATH is defined, so following provider sources are ignored ['/usr/local/share/plainbox-providers-1', '/usr/share/plainbox-providers-1', '/home/ubuntu/.local/share/plainbox-providers-1', '/var/tmp/checkbox-providers-develop'] 
===========================[ Running Selected Jobs ]============================
=========[ Running job 1 / 4. Estimated time left (at least): 0:00:02 ]=========
---------------------[ Collect information about the CPU ]----------------------
ID: com.canonical.certification::cpuinfo
Category: com.canonical.certification::information_gathering
... 8< -------------------------------------------------------------------------
<OMITTED>
------------------------------------------------------------------------- >8 ---
Outcome: job passed
=========[ Running job 4 / 4. Estimated time left (at least): 0:00:00 ]=========
-----[ Tests thermald's adaptive engine startup by monitoring its output. ]-----
ID: com.canonical.certification::miscellanea/check-thermald-adaptive-engine
Category: com.canonical.plainbox::miscellanea
... 8< -------------------------------------------------------------------------
2025-10-03 15:44:03 - INFO - === THERMALD ADAPTIVE ENGINE TEST ===
2025-10-03 15:44:03 - INFO - This test verifies that thermald's adaptive engine starts correctly.
2025-10-03 15:44:03 - INFO - Monitoring thermald output for adaptive engine initialization patterns...
2025-10-03 15:44:03 - INFO - Success pattern: 'Start main loop'
2025-10-03 15:44:03 - INFO - Failure pattern: 'Also unable to evaluate any conditions'
2025-10-03 15:44:03 - INFO - Command: thermald --no-daemon --loglevel=debug --adaptive
2025-10-03 15:44:03 - INFO - Timeout: 15 seconds
2025-10-03 15:44:03 - INFO - ======================================================================
2025-10-03 15:44:03 - INFO - --- Checking thermald systemd service ---
2025-10-03 15:44:03 - INFO - Thermald service is running. Stopping it...
2025-10-03 15:44:05 - INFO - Thermald service stopped successfully.
2025-10-03 15:44:05 - INFO - Started thermald with adaptive engine (PGID: 31795)
2025-10-03 15:44:05 - INFO - Started pattern monitoring (grep PID: 31796)
2025-10-03 15:44:05 - INFO - Waiting for adaptive engine initialization patterns...
2025-10-03 15:44:06 - INFO - --- Cleaning up test processes ---
2025-10-03 15:44:06 - INFO - Sending SIGTERM to thermald process group 31795...
2025-10-03 15:44:08 - INFO - Thermald process group terminated gracefully.
2025-10-03 15:44:08 - INFO - --- Restarting thermald systemd service ---
2025-10-03 15:44:08 - INFO - Thermald service restarted successfully.
2025-10-03 15:44:08 - INFO - ======================================================================
2025-10-03 15:44:08 - INFO - === THERMALD ADAPTIVE ENGINE TEST RESULT ===
2025-10-03 15:44:08 - INFO - FAILURE: Thermald adaptive engine failed to initialize.
Found failure pattern first - thermald fell back to highest power profile.
2025-10-03 15:44:08 - INFO - FAILED: Thermald adaptive engine did not start properly.
2025-10-03 15:44:08 - INFO - ======================================================================
------------------------------------------------------------------------- >8 ---
Outcome: job failed
Finalizing session that hasn't been submitted anywhere: checkbox-run-2025-10-03T07.44.03
==================================[ Results ]===================================
 ☑ : Collect information about the CPU
 ☑ : Check if thermald is active
 ☑ : Collect information about installed software packages
 ☒ : Tests thermald's adaptive engine startup by monitoring its output.

@snalvc snalvc requested a review from a team as a code owner October 3, 2025 07:46
@snalvc snalvc force-pushed the thermald-adaptive-engine branch from f2fb5e4 to 3f5fd5a Compare October 3, 2025 07:51
@snalvc snalvc force-pushed the thermald-adaptive-engine branch from 3f5fd5a to 610c0d3 Compare October 3, 2025 08:04
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in a week.

@github-actions github-actions bot added the Stale label Dec 3, 2025
@snalvc snalvc removed the Stale label Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant