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

Fix Random UT Failure: PosixFile (#2835) #2860

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

rlcheng
Copy link
Collaborator

@rlcheng rlcheng commented Sep 4, 2024

  • Fix UT failing FinalizeCrc test when crc calculation miss match. Miss match due to file crc and shadow being out of sync when both are not reinialized at the same time.

  • Update File::open in File.ccp to match shadow operation in FileRules.cpp to only reset crc when status is OP_OK.

  • Update FileRules.cpp to print out rule name during test.

  • Remove changing file mode in shadow_open() in FileRules.cpp to OPEN_NO_MODE when status is not OP_OK.

Related Issue(s)
Has Unit Tests (y/n)
Documentation Included (y/n)

Change Description

A description of the changes contained in the PR.

Rationale

A rationale for this change. e.g. fixes bug, or most projects need XYZ feature.

Testing/Review Recommendations

Fill in testing procedures, specific items to focus on for review, or other info to help the team verify these changes are flight-quality.

Future Work

Note any additional work that will be done relating to this issue.

 * Fix UT failing FinalizeCrc test when crc calculation miss match.
   Miss match due to file crc and shadow being out of sync when
   both are not reinialized at the same time.

 * Update File::open in File.ccp to match shadow operation in
   FileRules.cpp to only reset crc when status is OP_OK.

 * Update FileRules.cpp to print out rule name during test.

 * Remove changing file mode in shadow_open() in FileRules.cpp to
   OPEN_NO_MODE when status is not OP_OK.
@@ -256,6 +258,7 @@ bool Os::Test::File::Tester::OpenBaseRule::precondition(const Os::Test::File::Te

void Os::Test::File::Tester::OpenBaseRule::action(Os::Test::File::Tester &state //!< The test state
) {
printf("--> Rule: %s \n", this->getName());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be implemented at the STest level? It seems pretty convenient

How does one get access to those logs btw? I am assuming it gets captured by GoogleTest and put in a log file somewhere?

@LeStarch LeStarch merged commit 66d5128 into nasa:devel Sep 4, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants