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

CS_RecomputeAppChildTask_Test_DefEntryId sets up handler for wrong function key #44

Closed
2 tasks done
irowebbn opened this issue Sep 26, 2022 · 3 comments · Fixed by #65
Closed
2 tasks done

CS_RecomputeAppChildTask_Test_DefEntryId sets up handler for wrong function key #44

irowebbn opened this issue Sep 26, 2022 · 3 comments · Fixed by #65
Milestone

Comments

@irowebbn
Copy link

irowebbn commented Sep 26, 2022

Checklist (Please check before submitting)

  • I reviewed the Contributing Guide.
  • I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug
A clear and concise description of what the bug is.

The CS_RecomputeAppChildTask_Test_DefEntryId sets the handler CS_COMPUTE_TEST_CFE_ES_GetModuleInfoHandler1 for the function key CFE_ES_GetAppInfo when it should use the key CFE_ES_GetModuleInfo. The function under test, CS_RecomputeAppChildTask does not call CFE_ES_GetAppInfo, but rather CFE_ES_GetModuleInfo, which in turn calls CFE_GetAppInfo. Without the handler set for this function, some properties of AppInfo in the test may not be set and will cause the test to fail on some systems.

To Reproduce
Steps to reproduce the behavior:

  1. Build as usual
  2. Navigate to unit-tests of cs in build tree (for me, build/intel64/default_intel64/apps/cs/unit-test)
  3. Run ctest -vvv --output-on-failure
  4. See test errors:
[BEGIN] 33 CS_RecomputeAppChildTask_Test_DefEntryI
[ PASS] 33.001 cs_compute_tests.c:1577 - CS_AppData.RecomputeAppEntryPtr->State (99) == 99 (99)
[ PASS] 33.002 cs_compute_tests.c:1578 - CS_AppData.DefAppTblPtr[CS_AppData.ChildTaskEntryID].State (1) == CS_STATE_ENABLED (1)
[ FAIL] 33.003 cs_compute_tests.c:1579 - CS_AppData.RecomputeAppEntryPtr->TempChecksumValue (1) == 0 (0)
[ FAIL] 33.004 cs_compute_tests.c:1580 - CS_AppData.RecomputeAppEntryPtr->ByteOffset (2) == 0 (0)
[ FAIL] 33.005 cs_compute_tests.c:1581 - CS_AppData.RecomputeAppEntryPtr->ComputedYet (0) == true (1)
[ FAIL] 33.006 cs_compute_tests.c:1583 - context_CFE_EVS_SendEvent[0].EventID (128) == CS_RECOMPUTE_FINISH_APP_INF_EID (99)
[ FAIL] 33.007 cs_compute_tests.c:1584 - context_CFE_EVS_SendEvent[0].EventType (1) == CFE_EVS_EventType_INFORMATION (2)
[ FAIL] 33.008 cs_compute_tests.c:1587 - String: 'App %s recompute finished. New baseline is 0x%08X' == 'CS cannot get a valid address for %s, due to the platform'
[ PASS] 33.009 cs_compute_tests.c:1589 - CS_AppData.HkPacket.RecomputeInProgress (0) == false (0)
[ FAIL] 33.010 cs_compute_tests.c:1591 - CallCount CFE_EVS_SendEvent() (3) == 1 (1)
[  END] 33 CS_RecomputeAppChildTask_Test_DefEntryI TOTAL::10    PASS::3     FAIL::7     MIR::0     TSF::0     TTF::0     WARN::0   

Expected behavior
The test should pass.

Code snips
If applicable, add references to the software.

UT_SetHandlerFunction(UT_KEY(CFE_ES_GetAppInfo), CS_COMPUTE_TEST_CFE_ES_GetModuleInfoHandler1, NULL);

System observed on:

  • CS release tag draco-rc3
  • Hardware: x86_64 Intel
  • OS: CentOS 7
  • Versions: cFE draco-rc3, OSAL draco-rc3, PSP draco-rc2

Additional context
Add any other context about the problem here.

Reporter Info
Full name and company/organization if applicable
Isaac Rowe, NASA JSC (Jacobs Technology)

irowebbn added a commit to irowebbn/CS that referenced this issue Sep 26, 2022
@chillfig
Copy link
Contributor

Hey @irowebbn , thank you for the issue and pr. Are you running the latest cFS when you see the CS_RecomputeAppChildTask_Test_DefEntryId() test failures? If you navigate to https://github.com/nasa/CS/actions/runs/3069268060 -> "Unit Test and coverage results" (under "Artifacts") -> lcov_results.txt, it shows PASS for each of the asserts of CS_RecomputeAppChildTask_Test_DefEntryId(). This is the latest unit test coverage run of nasa/cs's main branch.

@irowebbn
Copy link
Author

irowebbn commented Oct 4, 2022

I noticed that the test were passing in the CI, but I wasn't able to determine what about the environment was different that would cause a failure.

The cFS I was using consisted of : cFE draco-rc3, OSAL draco-rc3, PSP draco-rc2

@thnkslprpt
Copy link
Contributor

Tests failing on nasa/CS main branch as well now (see https://github.com/thnkslprpt/CS/actions/runs/4333025360/jobs/7565890664#step:11:3742).

I will submit a PR with the change identified by @irowebbn fixing the tests so that it doesn't start holding up other PRs.

thnkslprpt added a commit to thnkslprpt/CS that referenced this issue Mar 4, 2023
dzbaker added a commit that referenced this issue Mar 9, 2023
…ailing-tests

Fix #44, Update function key in CS_RecomputeAppChildTask_Test_DefEntryId
@chillfig chillfig added this to the Draco milestone Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants