Skip to content
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

tests/subsys/fs/nvs: Fix flakiness due to not init'ed data #86357

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aescolar
Copy link
Member

@aescolar aescolar commented Feb 26, 2025

This test has been seen failing at random (though not often). A valgrind check showed the nvs_ate structures were being CRC'ed with not-initialized data, and checked later (assuming the CRC would be different than a constant).
This may have been the cause of the test failures, so let's initialize the whole structure to prevent the CRC value from depending on random memory/stack content.

@aescolar aescolar added this to the v4.1.0 milestone Feb 26, 2025
@aescolar aescolar marked this pull request as ready for review February 26, 2025 12:25
@Laczen
Copy link
Collaborator

Laczen commented Feb 26, 2025

Hi @aescolar thanks for the PR. In nvs the .part (that is unused) is set to 0xff, maybe it is better to also do this here.

This test has been seen failing at random (though not often).
A valgrind check showed the nvs_ate structures were being
CRC'ed with not-initialized data, and checked later (assuming
the CRC would be different than a constant).
This maybe have been the cause of the test failures, so let's
initialize the whole structure to prevent the CRC value
from depending on random memory/stack content.

Signed-off-by: Alberto Escolar Piedras <[email protected]>
@aescolar aescolar force-pushed the tests_subsys_fs_nvs_flaky2 branch from cca1337 to 1515929 Compare February 26, 2025 12:42
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.

4 participants