Skip to content

Fix intermittent sync fail in tests-filesystem-general_filesystem #12850

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
Apr 24, 2020

Conversation

kyle-cypress
Copy link

Summary of changes

tests-filesystem-general_filesystem declares BlockDevice and FileSystem pointers as globals. If these are initialized to their respective default_instance values in the declaration, the LFS init happens during OS startup when __libc_init_array() is invoked by mbed_toolchain_init().
If the filesystem blockdevice does not currently contain a valid filesystem (e.g. the chip has just been erased), then LFS will flag this as corruption and abort the mounting process.
This cleanup process can take long enough (and is running pre-main) that greentea times out waiting for the device to respond to its sync packet, and resets the device.
To resolve this, move the initialization into the first test case (bd_init_fs_reformat) right before it initializes and formats the blockdevice and filesystem.

Impact of changes

NA

Migration actions required

NA

Documentation

NA


Pull request type

[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

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

The sleep test failures are known issues that are being worked on.
The failures on CY8CPROTO_064_SB are an intermittent pyocd programming failure.

GT_FT_KIT_062_BLE_GCC.txt
GT_FT_KIT_062_WIFI_BT_GCC.txt
GT_FT_KIT_062S2_43012_GCC.txt
GT_FT_P6S1_43012EVB_01_GCC.txt
GT_FT_PROTO_062_4343W_GCC.txt
GT_FT_PROTO_062S3_4343W.txt
GT_FT_PROTO_064_SB_GCC.txt


Reviewers

@ARMmbed/team-cypress


tests-filesystem-general_filesystem declares BlockDevice and FileSystem
pointers as globals. If these are initialized to their respective
default_instance values in the declaration, the LFS init happens during
OS startup when __libc_init_array() is invoked by mbed_toolchain_init().
If the filesystem blockdevice does not currently contain a valid filesystem
(e.g. the chip has just been erased), then LFS will flag this as corruption
and abort the mounting process.
This cleanup process can take long enough (and is running pre-main) that
greentea times out waiting for the device to respond to its sync packet,
and resets the device.
To resolve this, move the initialization into the first test case
(bd_init_fs_reformat) right before it initializes and formats the
blockdevice and filesystem.
@ciarmcom ciarmcom requested review from a team April 23, 2020 01:00
@ciarmcom
Copy link
Member

@kyle-cypress, thank you for your changes.
@ARMmbed/mbed-os-storage @ARMmbed/mbed-os-maintainers please review.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 23, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Apr 23, 2020

Test run: SUCCESS

Summary: 4 of 4 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 merged commit 906999a into ARMmbed:master Apr 24, 2020
@mergify mergify bot removed the ready for merge label Apr 24, 2020
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.

5 participants