Test: Watchdog: Update the deepsleep wait

Extend the deepsleep wait up to 220% of the Watchdog timeout.
One of the current Watchdog timing requirements is to fire BEFORE twice
the timeout value, but at least one target (K64F) is expected to fire
EXACTLY at a doubled timeout value in deepsleep mode. This patch updates
the test to cope with a new deepsleep timing requirement.
pull/11773/head
Filip Jagodzinski 2019-11-04 20:27:41 +01:00
parent 945a9b3ad5
commit 55e1a760cb
2 changed files with 12 additions and 4 deletions

View File

@ -197,8 +197,12 @@ void test_deepsleep_reset()
if (!sleep_manager_can_deep_sleep()) {
TEST_ASSERT_MESSAGE(0, "Deepsleep should be allowed.");
}
// Watchdog should fire before twice the timeout value.
ThisThread::sleep_for(2 * TIMEOUT_MS); // Device reset expected.
// The Watchdog reset is allowed to be delayed up to twice the timeout
// value when the deepsleep mode is active.
// To make the test less sensitive to clock/wait accuracy, add 20% extra
// (making tha whole deepsleep wait equal to 2.2 * timeout).
ThisThread::sleep_for(220 * TIMEOUT_MS / 100); // Device reset expected.
// Watchdog reset should have occurred during the deepsleep above.

View File

@ -188,8 +188,12 @@ void test_deepsleep_reset()
if (!sleep_manager_can_deep_sleep()) {
TEST_ASSERT_MESSAGE(0, "Deepsleep should be allowed.");
}
// Watchdog should fire before twice the timeout value.
ThisThread::sleep_for(2 * TIMEOUT_MS); // Device reset expected.
// The Watchdog reset is allowed to be delayed up to twice the timeout
// value when the deepsleep mode is active.
// To make the test less sensitive to clock/wait accuracy, add 20% extra
// (making tha whole deepsleep wait equal to 2.2 * timeout).
ThisThread::sleep_for(220 * TIMEOUT_MS / 100); // Device reset expected.
// Watchdog reset should have occurred during the deepsleep above.