Skip to content

Fix watchdog reset test #11773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 22, 2019
Merged

Conversation

fkjagodzinski
Copy link
Member

@fkjagodzinski fkjagodzinski commented Oct 30, 2019

Description (required)

Summary of change (What the change is for and why)

I fixed the Watchdog reset tests (both HAL & drier) with the following:

  • Added a watchdog-kicking thread, running in the background when the test suite is handling a failed assertion. This is to make sure all failures are processed correctly by greentea. This is especially important in case the watchdog reset is late and happens when the test suite teardown is doing its job.
  • Fixed the LP ticker macro in the test, so the deepsleep test case is actually executed.
  • Replaced deprecated API calls for wait/sleep with the current ones.
  • Updated the Watchdog timing requirements for the deepsleep mode according to findings from K64F: watchdog timeout doubled in deeplseep #11774 -- allow doubled timeout for this mode.

Also fixed the hal_watchdog_init() for K64F -- enabled the Watchdog for Debug and Stop modes, as required by https://github.com/ARMmbed/mbed-os-5-docs/blob/development/docs/porting/target/Watchdog.md#defined-behavior.

Documentation (Details of any document updates required)

Pull request type (required)

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results (required)

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers (optional)

@0xc0170, @jamesbeyond


Release Notes (required for feature/major PRs)

Summary of changes
Impact of changes
Migration actions required

Filip Jagodzinski added 5 commits October 30, 2019 12:51
Add a watchdog-kicking thread running in the background when the test
suite is handling a failed assertion. A single watchdog kick did not
provide enough time for the greentea communication if the watchdog
reset happened later than expected.
Replace the wait_ms() with wait_us().
Replace the Semaphore::wait() with Semaphore::acquire().
Wait for the serial buffers flush before starting the watchdog.
Use ThisThread::sleep_for() for sleeping instead of the calls to
Semaphore::acquire().
@ciarmcom
Copy link
Member

@fkjagodzinski, thank you for your changes.
@jamesbeyond @0xc0170 @ARMmbed/mbed-os-core @ARMmbed/mbed-os-test @ARMmbed/mbed-os-hal @ARMmbed/mbed-os-maintainers please review.

Enable the Watchdog Timer for the low-power stop modes of operation,
including the VLPS used in deepsleep.
Enable the Watchdog Timer for the Debug mode.
@fkjagodzinski
Copy link
Member Author

I think this PR is complete now; ready for review. The recent update fixes the K64F Watchdog mode settings (enables the Watchdog for Debug and Stop modes) and extends the deepsleep wait time according to findings from #11774.

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.
@fkjagodzinski fkjagodzinski force-pushed the fix-watchdog_reset_test branch from 6529d4a to 55e1a76 Compare November 5, 2019 10:50
@fkjagodzinski
Copy link
Member Author

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 13, 2019

I started CI , will review soon

@mbed-ci
Copy link

mbed-ci commented Nov 13, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test

@fkjagodzinski
Copy link
Member Author

I can see one failed test case:
features-storage-tests-kvstore-general_tests_phase_1 | TDB_set_key_init_deinit.
Doesn't look related to this patch.

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 14, 2019

Test failed because of #11862, we will investigate

@0xc0170 0xc0170 removed request for a team November 14, 2019 14:00
@0xc0170
Copy link
Contributor

0xc0170 commented Nov 15, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Nov 15, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

Copy link
Contributor

@mprse mprse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done 👍

@fkjagodzinski
Copy link
Member Author

@jamesbeyond could you review please?

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 22, 2019

I'll rerun CI in the meantime to get an update

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 22, 2019

@jamesbeyond If approved within today, will be in 5.15 (marked as such).

@mbed-ci
Copy link

mbed-ci commented Nov 22, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 3
Build artifacts

Copy link
Contributor

@jamesbeyond jamesbeyond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am happy about the changes

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

Successfully merging this pull request may close these issues.

6 participants