Skip to content

Handle NVStore tests in a low memory environment #7746

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 1 commit into from
Sep 24, 2018

Conversation

davidsaada
Copy link
Contributor

@davidsaada davidsaada commented Aug 9, 2018

Description

Previous fix to NVStore tests measured how much memory is available for threads (in the multi thread tests) and lowered number of threads accordingly. This was problematic in two aspects:

  1. Other memory allocations weren't checked. In low memory boards, we can fail on them as well (probably the problem we see in #7555).
  2. Lowering number of threads hurts the test credibility.

Therefore, this PR simply checks each and every memory allocation in these tests (using std::nothrow), and skips the remainder of the test (without failing it) if memory can't be allocated.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Feature
[ ] Breaking change

Copy link
Contributor

@yossi2le yossi2le left a comment

Choose a reason for hiding this comment

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

Looks fine for me. Approved

@bentcooke
Copy link
Contributor

@davidsaada After applying this patch, the MOTE_L152RC still hard faults for the nvstore tests:

mbedgt: mbed-host-test-runner: started
[1534274654.46][HTST][INF] host test executor ver. 1.3.1
[1534274654.46][HTST][INF] copy image onto target...
[1534274654.46][COPY][INF] Waiting up to 60 sec for '41000221E2B81D47DDFCCD7A' mount point (current is '/mnt/pci-0000_00_1a_0-usb-0_1_6_1_1-scsi-0_0_0_0')...
[1534274664.73][HTST][INF] starting host test process...
[1534274664.73][CONN][INF] starting connection process...
[1534274664.73][CONN][INF] notify event queue about extra 60 sec timeout for serial port pooling
[1534274664.73][CONN][INF] initializing serial port listener...
[1534274664.73][PLGN][INF] Waiting up to 60 sec for '41000221E2B81D47DDFCCD7A' serial port (current is '/dev/ttyACM0')...
[1534274664.73][HTST][INF] setting timeout to: 60 sec
[1534274664.75][SERI][INF] serial(port=/dev/ttyACM0, baudrate=9600, read_timeout=0.01, write_timeout=5)
[1534274664.75][SERI][INF] reset device using 'default' plugin...
[1534274664.85][SERI][INF] waiting 1.00 sec after reset
[1534274665.85][SERI][INF] wait for it...
[1534274665.86][SERI][TXD] mbedmbedmbedmbedmbedmbedmbedmbedmbedmbed
[1534274665.86][CONN][INF] sending up to 5 __sync packets (specified with --sync=5)
[1534274665.86][CONN][INF] sending preamble '78f58122-fc63-4761-b95f-5c905dcd2719'
[1534274665.89][SERI][TXD] {{__sync;78f58122-fc63-4761-b95f-5c905dcd2719}}
[1534274665.99][CONN][RXD] mbedmbedmbedmbedmbedmbedmbedmbed
[1534274666.04][CONN][INF] found SYNC in stream: {{__sync;78f58122-fc63-4761-b95f-5c905dcd2719}} it is #0 sent, queued...
[1534274666.04][HTST][INF] sync KV found, uuid=78f58122-fc63-4761-b95f-5c905dcd2719, timestamp=1534274666.039608
[1534274666.06][CONN][INF] found KV pair in stream: {{__version;1.3.0}}, queued...
[1534274666.06][HTST][INF] DUT greentea-client version: 1.3.0
[1534274666.08][CONN][INF] found KV pair in stream: {{__timeout;120}}, queued...
[1534274666.08][HTST][INF] setting timeout to: 120 sec
[1534274666.11][CONN][INF] found KV pair in stream: {{__host_test_name;default_auto}}, queued...
[1534274666.11][HTST][INF] host test class: '<class 'mbed_host_tests.host_tests.default_auto.DefaultAuto'>'
[1534274666.11][HTST][INF] host test setup() call...
[1534274666.11][HTST][INF] CALLBACKs updated
[1534274666.11][HTST][INF] host test detected: default_auto
[1534274666.14][CONN][INF] found KV pair in stream: {{__testcase_count;3}}, queued...
[1534274666.17][CONN][RXD] >>> Running 3 test cases...
[1534274666.22][CONN][INF] found KV pair in stream: {{__testcase_name;NVStore: Basic functionality}}, queued...
[1534274666.26][CONN][INF] found KV pair in stream: {{__testcase_name;NVStore: Race test}}, queued...
[1534274666.32][CONN][RXD]
[1534274666.32][CONN][INF] found KV pair in stream: {{__testcase_name;NVStore: Multiple thread test}}, queued...
[1534274666.38][CONN][RXD] >>> Running case #1: 'NVStore: Basic functionality'...
[1534274666.43][CONN][INF] found KV pair in stream: {{__testcase_start;NVStore: Basic functionality}}, queued...
[1534274666.45][CONN][RXD] NVStore areas:
[1534274666.75][CONN][RXD] Area 0: address 0x0803e000, size 4096 (0x1000)
[1534274666.80][CONN][RXD] Area 1: address 0x0803f000, size 4096 (0x1000)
[1534274667.34][CONN][RXD] Max keys 20 (out of 255 possible ones)
[1534274667.75][CONN][RXD]
[1534274667.78][CONN][RXD] ++ MbedOS Fault Handler ++
[1534274667.78][CONN][RXD]
[1534274667.81][CONN][RXD] FaultType: HardFault
[1534274667.82][CONN][RXD]
[1534274667.82][CONN][RXD] Context:
[1534274667.84][CONN][RXD] R0   : 20002008
[1534274667.86][CONN][RXD] R1   : 3803E0F8
[1534274667.87][CONN][RXD] R2   : FFFFFFE8
[1534274667.89][CONN][RXD] R3   : 00000000
[1534274667.91][CONN][RXD] R4   : 3803E0F8
[1534274667.92][CONN][RXD] R5   : 20002008
[1534274667.94][CONN][RXD] R6   : 00000008
[1534274667.95][CONN][RXD] R7   : 20002978
[1534274667.97][CONN][RXD] R8   : 00000000
[1534274667.99][CONN][RXD] R9   : 20002008
[1534274668.00][CONN][RXD] R10  : 000000BF
[1534274668.02][CONN][RXD] R11  : 00000017
[1534274668.04][CONN][RXD] R12  : 80000000
[1534274668.05][CONN][RXD] SP   : 20001FD0
[1534274668.07][CONN][RXD] LR   : 0800B43B
[1534274668.08][CONN][RXD] PC   : 080015C4
[1534274668.10][CONN][RXD] xPSR : 81004400
[1534274668.12][CONN][RXD] PSP  : 20001FB0
[1534274668.13][CONN][RXD] MSP  : 20007FD8
[1534274668.15][CONN][RXD] CPUID: 412FC230
[1534274668.17][CONN][RXD] HFSR : 40000000
[1534274668.18][CONN][RXD] MMFSR: 00000000
[1534274668.21][CONN][RXD] BFSR : 00000082
[1534274668.22][CONN][RXD] UFSR : 00000000
[1534274668.24][CONN][RXD] DFSR : 00000008
[1534274668.26][CONN][RXD] AFSR : 00000000
[1534274668.27][CONN][RXD] BFAR : 3803E0F8
[1534274668.29][CONN][RXD] Mode : Thread
[1534274668.31][CONN][RXD] Priv : Privileged
[1534274668.32][CONN][RXD] Stack: PSP
[1534274668.32][CONN][RXD]
[1534274668.35][CONN][RXD] -- MbedOS Fault Handler --
[1534274668.35][CONN][RXD]
[1534274668.35][CONN][RXD]
[1534274668.35][CONN][RXD]
[1534274668.37][CONN][RXD] ++ MbedOS Error Info ++
[1534274668.42][CONN][RXD] Error Status: 0x80FF013D Code: 317 Module: 255
[1534274668.47][CONN][RXD] Error Message: Unrecoverable fault excaption.
[1534274668.49][CONN][RXD] Location: 0x800BB1B
[1534274668.51][CONN][RXD] Error Value: 0x80015C4
[1534274668.62][CONN][RXD] Current Thread: Id: 0x200022A8 Entry: 0x800D741 StackSize: 0x1000 StackMem: 0x200012A8 SP: 0x20007FA0
[1534274668.65][CONN][RXD] -- MbedOS Error Info --
[1534274786.77][HTST][INF] test suite run finished after 120.69 sec...
[1534274786.78][CONN][INF] received special event '__host_test_finished' value='True', finishing
[1534274786.81][HTST][INF] CONN exited with code: 0
[1534274786.81][HTST][INF] No events in queue
[1534274786.81][HTST][INF] stopped consuming events
[1534274786.81][HTST][INF] host test result(): None
[1534274786.81][HTST][WRN] missing __exit event from DUT
[1534274786.81][HTST][WRN] missing __exit_event_queue event from host test
[1534274786.81][HTST][ERR] missing __exit_event_queue event from host test and no result from host test, timeout...
[1534274786.81][HTST][INF] calling blocking teardown()
[1534274786.81][HTST][INF] teardown() finished
[1534274786.81][HTST][INF] {{result;timeout}}

@davidsaada
Copy link
Contributor Author

@bentcooke If you could connect the board to a raas node, I may have a look at this error from remote.

@bentcooke
Copy link
Contributor

@davidsaada it is on a raas node now... address provided by email.

@davidsaada davidsaada force-pushed the david_nvstore_test_low_mem branch from 65f03c9 to 8f17daa Compare August 17, 2018 20:26
@davidsaada
Copy link
Contributor Author

Rebased following merge of #7670 (as both modify the NVstore tests).

@davidsaada davidsaada force-pushed the david_nvstore_test_low_mem branch 2 times, most recently from 7412310 to dbff75e Compare August 21, 2018 15:46
@davidsaada
Copy link
Contributor Author

Rebased again.
And issue reported by @bentcooke is not related to this PR. Plz see discussion in #7534.

@davidsaada
Copy link
Contributor Author

@0xc0170 @kjbracey-arm Can you please review? As the problem in MOTE_L152RC board has long been resolved.

@davidsaada
Copy link
Contributor Author

@0xc0170 @kjbracey-arm Would appreciate a review here, as this PR resolves a few open issues.

@jeromecoutant
Copy link
Collaborator

Hi
Is it possible to solve merge conflicts ?
Thx

@davidsaada davidsaada force-pushed the david_nvstore_test_low_mem branch from dbff75e to 744300f Compare September 11, 2018 11:41
@davidsaada
Copy link
Contributor Author

Is it possible to solve merge conflicts ?

Ah yes. Sorry about that. Whole NVStore directory has moved. Rebased now.

@davidsaada davidsaada force-pushed the david_nvstore_test_low_mem branch 2 times, most recently from 0a05f3c to 2ebf9ff Compare September 12, 2018 10:42
Copy link
Collaborator

@jeromecoutant jeromecoutant left a comment

Choose a reason for hiding this comment

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

Tested OK with DISCO_L072

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 18, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Sep 18, 2018

Build : SUCCESS

Build number : 3093
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7746/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Sep 18, 2018

@mbed-ci
Copy link

mbed-ci commented Sep 18, 2018

@davidsaada davidsaada force-pushed the david_nvstore_test_low_mem branch from 2ebf9ff to 999042d Compare September 20, 2018 08:54
@davidsaada
Copy link
Contributor Author

Fixed test issues in problematic board.

@cmonr
Copy link
Contributor

cmonr commented Sep 22, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Sep 23, 2018

Build : SUCCESS

Build number : 3129
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7746/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Sep 23, 2018

@mbed-ci
Copy link

mbed-ci commented Sep 23, 2018

@0xc0170 0xc0170 merged commit e7cd6ae into ARMmbed:master Sep 24, 2018
@davidsaada davidsaada deleted the david_nvstore_test_low_mem branch January 14, 2019 10:03
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.

8 participants