Skip to content

Conversation

arikgreen
Copy link
Contributor

@arikgreen arikgreen commented Oct 14, 2025

Fix for collecting and presenting measured data.
During verify measured values, the test skipped all results after the first incorrect one.
Furthermore, it duplicated already collected data on the output list.
So in this case the result list include wrong data.
The result after fail:

[{'expected_rms_ua': 5.6}, {'tolerance_ua': 1.12}, {'measured_rms_ua': 5.65}]
[{'expected_rms_ua': 0.4}, {'tolerance_ua': 0.08}, {'measured_rms_ua': 0.39}]
[{'expected_rms_ua': 0.14}, {'tolerance_ua': 0.03}, {'measured_rms_ua': 0.11}] <-- this measured value trigger a fail, but we don't see because accuracy is too low
[{'expected_rms_ua': 5.6}, {'tolerance_ua': 1.12}, {'measured_rms_ua': 5.65}]
[{'expected_rms_ua': 0.4}, {'tolerance_ua': 0.08}, {'measured_rms_ua': 0.39}]
[{'expected_rms_ua': 0.14}, {'tolerance_ua': 0.03}, {'measured_rms_ua': 0.11}]

It should looks like:

"[{'expected_rms_ua': 5.6}, {'tolerance_ua': 1.12}, {'measured_rms_ua': 5.647}]"
"[{'expected_rms_ua': 0.4}, {'tolerance_ua': 0.08}, {'measured_rms_ua': 0.388}]"
"[{'expected_rms_ua': 0.14}, {'tolerance_ua': 0.03}, {'measured_rms_ua': 0.109}]" <-- this measured value trigger a fail
"[{'expected_rms_ua': 0.03}, {'tolerance_ua': 0.01}, {'measured_rms_ua': 0.027}]"
"[{'expected_rms_ua': 14.0}, {'tolerance_ua': 2.8}, {'measured_rms_ua': 13.606}]"

The part of twister log:

INFO: Stopping data acquisition...
DEBUG: Measured RMS values in mA: [np.float64(5.654448390178646), np.float64(0.37803122099654946), np.float64(0.10985806520053602), np.float64(0.02664327621459961), np.float64(13.615673289676113)]
DEBUG: Expected RMS: 5.60 mA
DEBUG: Tolerance: 1.12 mA
DEBUG: Measured  RMS: 5.65 mA
INFO: RECORD: [{"expected_rms_ua": 5.60},{"tolerance_ua": 1.12},{"measured_rms_ua": 5.65}]
DEBUG: Expected RMS: 0.40 mA
DEBUG: Tolerance: 0.08 mA
DEBUG: Measured  RMS: 0.38 mA
INFO: RECORD: [{"expected_rms_ua": 0.40},{"tolerance_ua": 0.08},{"measured_rms_ua": 0.38}]
DEBUG: Expected RMS: 0.14 mA
DEBUG: Tolerance: 0.03 mA
DEBUG: Measured  RMS: 0.11 mA
INFO: RECORD: [{"expected_rms_ua": 0.14},{"tolerance_ua": 0.03},{"measured_rms_ua": 0.11}]
FAILED

It is confused because the measured value: 0.11 should not trigger fail but real value is 0.109858....

From the analysis of the the masurments so far it follows that
the expected value of the state_1 is too hight.
Change expected value of state_1 from 0.14 to 0.12.
Regarding the test:
  tests/subsys/pm/power_states

Signed-off-by: Artur Wilczak <[email protected]>
Fix for collecting and presenting measured data.
During verify measured values, the test skipped all results
after the first incorrect one. Furthermore, it duplicated
already collected data on the output list. So in this case the
result list include wrong data.

Signed-off-by: Artur Wilczak <[email protected]>
@arikgreen arikgreen force-pushed the arikgreen/fix-power-management-test branch from 7b982fa to 8c79165 Compare October 14, 2025 21:38
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Power Management area: Tests Issues related to a particular existing or missing test area: Twister Twister

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants