Home
last modified time | relevance | path

Searched hist:57632095 (Results 1 – 1 of 1) sorted by relevance

/openbmc/pldm/platform-mc/test/
H A Dsensor_manager_test.cpp57632095 Wed Aug 21 10:52:40 CDT 2024 Thu Nguyen <thu@os.amperecomputing.com> platform-mc: Fix `sensorPollingTest` unit-test error

Even the `doSensorPolling` task is scheduled to run after each
`SENSOR_POLLING_TIME` milliseconds, it does not mean that the kernel
will trigger `doSensorPolling` task at time `t0`, `t0 +
SENSOR_POLLING_TIME`, `t0 + 2*SENSOR_POLLING_TIME`, .., `t0 +
n*SENSOR_POLLING_TIME` because the kernel can busy so it may trigger the
schedule task late. This causes the number of the triggered
`doSensorPolling` tasks after `n*SENSOR_POLLING_TIME` milliseconds can
be less than `n`.
That why the current `sensorPollingTest` unit-test sometime is failed
with below errors especially when run the unit-test in slow local
machine.
```
Actual function call count doesn't match EXPECT_CALL(sensorManager, doSensorPolling(tid))...
Expected: to be called at least 100 times
Actual: called 40 times - unsatisfied and active
```

Update the `sensorPollingTest` to check the interval between two
triggered times of the `doSensorPolling` tasks instead of number called
times. This interval should greater than SENSOR_POLLING_TIME ms.

Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
Signed-off-by: Khang Nguyen <khangng@amperecomputing.com>
Change-Id: I33c31ceba76476ae7f9396f2bbf84093fe3f2519