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

HPCC-33333 In GH Unittest Action change the test case execution sequence and add core file check. #19469

Open
wants to merge 2 commits into
base: candidate-9.6.x
Choose a base branch
from

Conversation

AttilaVamos
Copy link
Contributor

@AttilaVamos AttilaVamos commented Jan 31, 2025

Phase 1:

  • Change the execution sequence and log the test case name

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change improves the code (refactor or other change that does not change the functionality)
  • This change fixes warnings (the fix does not alter the functionality or the generated code)
  • This change is a breaking change (fix or feature that will cause existing behavior to change).
  • This change alters the query API (existing queries will have to be recompiled)

Checklist:

  • My code follows the code style of this project.
    • My code does not create any new warnings from compiler, build system, or lint.
  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit is signed.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the CONTRIBUTORS document.
  • The change has been fully tested:
    • I have added tests to cover my changes.
    • All new and existing tests passed.
    • I have checked that this change does not introduce memory leaks.
    • I have used Valgrind or similar tools to check for potential issues.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Cloud-compatibility
    • Premature optimization
    • Existing deployed queries will not be broken
    • This change fixes the problem, not just the symptom
    • The target branch of this pull request is appropriate for such a change.
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised JIRA issues to address them separately
  • This is a user interface / front-end modification
    • I have tested my changes in multiple modern browsers
    • The component(s) render as expected

Smoketest:

  • Send notifications about my Pull Request position in Smoketest queue.
  • Test my draft Pull Request.

Testing:

Copy link

Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-33333

Jirabot Action Result:
Workflow Transition To: Merge Pending
Updated PR

@AttilaVamos
Copy link
Contributor Author

@Michael-Gardner please review this change.

Copy link
Contributor

@Michael-Gardner Michael-Gardner left a comment

Choose a reason for hiding this comment

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

Attila this looks great.

@AttilaVamos AttilaVamos force-pushed the HPCC-33333-impr-9.6.x branch from 3e954d7 to e1f4ac5 Compare February 4, 2025 15:38
@AttilaVamos
Copy link
Contributor Author

@ghalliday please merge

Copy link
Member

@jakesmith jakesmith left a comment

Choose a reason for hiding this comment

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

@AttilaVamos - please see comments.

@@ -41,6 +43,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y ${{ inputs.dependencies }}
sudo apt-get install -y gdb
echo 'core_%e.%p' | sudo tee /proc/sys/kernel/core_pattern
Copy link
Member

Choose a reason for hiding this comment

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

looks sensible. Do we already do this somewhere for regular hpcc components, and hence it's not an issue when they core?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OBT is using this kind of core creation setting in years now.

Copy link
Member

Choose a reason for hiding this comment

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

ok, unrelated to this PR, but does the github smoketest action also need it to ensure cores/stacks created and upload to artifacts where too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See PR-19478/HPCC-33362

echo "--------------------------------------"
sudo /opt/HPCCSystems/bin/unittests -e "$test"
echo " "
done< <(/opt/HPCCSystems/bin/unittests -l | sort )
Copy link
Member

Choose a reason for hiding this comment

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

Seems sensible - this is mainly being done, so each unittest is run in sequence with some extra logging in between?
Am I correct in thinking it will stop (action step fail) when if 1st unittest fails, i.e. not continue to run others? (I think that's fine btw, just checking)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the step fail at the first failed test.


- name: unittests-logs-artifact
if: ${{ failure() || cancelled() }}
if: ${{ failure() || cancelled() || env.UPLOAD_ARTIFACT == 'true'}}
Copy link
Member

Choose a reason for hiding this comment

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

why is || UPLOAD_ARTIFACT == 'true' needed?

The previous step always returns -1 if there were cores, and hence failure() should be true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, removed.


- name: Check for Core files
run: |
CORE_FILES=( $(sudo find /opt/HPCCSystems/bin/ /var/lib/HPCCSystems/ -iname 'core*' -type f -print) )
Copy link
Member

Choose a reason for hiding this comment

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

are you sure these are the right directories to look in?

if unittest cores, it will dump in the current working director which will be the runner cwd afaics - i.e. there won't be any core files in /opt/HPCCSystems/bin/ or /var/lib/HPCCSystems/.

Also, is 'sudo' necessary?

If there can only be <=1 core and only from unittest in cwd then this could be simplified to:

    shopt -s nullglob
    CORE_FILES=(core*)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed

Copy link
Member

@jakesmith jakesmith left a comment

Choose a reason for hiding this comment

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

@AttilaVamos - looks good. Please squash.

1 question re. core pattern/files/stacks in smoketest beyond scope of this PR.

@AttilaVamos AttilaVamos force-pushed the HPCC-33333-impr-9.6.x branch from ac44944 to bbe2af2 Compare February 7, 2025 14:01
@jakesmith jakesmith self-requested a review February 7, 2025 14:16
@@ -52,9 +53,43 @@ jobs:
timeout-minutes: 10 # generous, expected time is approx 1 min.
shell: "bash"
run: |
set +e # Ignore intermediate error(s) in this step
Copy link
Member

Choose a reason for hiding this comment

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

Is this going to mean that it will no longer stop after 1st unittest failure, and could run through all (generating a core file for each potentially) ?

That may be okay, but what is the intent of the set +e here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If "Bash"specified, then "bash -e {0}" executed internally. You can claim it need to fail fast, then I will remove the 'set +e'.

@AttilaVamos AttilaVamos force-pushed the HPCC-33333-impr-9.6.x branch from bbe2af2 to a76638c Compare February 7, 2025 15:16
@AttilaVamos AttilaVamos marked this pull request as draft February 7, 2025 23:34
…ce and add core file check.

Phase 1:
- Change the executon sequence and log the test case name
- Add core check and core tracing generation code

Signed-off-by: Attila Vamos <[email protected]>
@AttilaVamos AttilaVamos force-pushed the HPCC-33333-impr-9.6.x branch from 678055b to 61662b9 Compare February 10, 2025 16:18
Signed-off-by: Attila Vamos <[email protected]>
@AttilaVamos AttilaVamos force-pushed the HPCC-33333-impr-9.6.x branch from 61662b9 to f1e7e60 Compare February 10, 2025 18:00
@AttilaVamos AttilaVamos marked this pull request as ready for review February 10, 2025 22:11
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