opennms
opennms copied to clipboard
Improve smoke-test container debugging with progress bar
This builds on #5322 to take advantage of the combination of all of them to include OpenNMS startup exceptions in smoke test failure messages (without needing to look at logs to see what exception occurred):
- Use bash strict mode for Horizon container entrypoint.sh
- Add "-S" option to quiet down Horizon container entrypoint.sh
- Use "-S" option for Horizon container to quiet down output
- Outside of CI, follow the OpenNMS container output
- Replace the REST and OpenNMS startup checks with the progress bar check
- Fix a possible unset variable in Horizon entrypoint.sh
- I don't think we need log karaf to the console anymore
- Speedup thread dump collection and store in its own file
Example output
Here's a failure seen with OpenShiftCompatIT in CI and a part of the failure stack trace showing exactly where the problem was:
Caused by: java.lang.IllegalStateException: Failed to start container. OpenNMS exception (if any)/container logs:
----------------------------------------------------------
/entrypoint.sh: Error on line 28: MYUSER="$(getent passwd "${MYID}" | cut -d: -f1)"
----------------------------------------------------------
at org.opennms.smoketest.containers.OpenNMSContainer$WaitForOpenNMS.waitUntilReady(OpenNMSContainer.java:465)
-- https://app.circleci.com/pipelines/github/OpenNMS/opennms/25476/workflows/61786477-7ea0-4490-ad29-ee098388ac7e/jobs/198874
All Contributors
- [x] Have you read our Contribution Guidelines?
- [x] Have you (electronically) signed the OpenNMS Contributor Agreement?
Contribution Checklist
- Please make an issue in the OpenNMS issue tracker if there isn't one already.
Once there is an issue, please:- update the title of this PR to be in the format:
${JIRA-ISSUE-NUMBER}: subject of pull request
- update the JIRA link at the bottom of this comment to refer to the real issue number
- prefix your commit messages with the issue number, if possible
- once you've created this PR, please link to it in a comment in the JIRA issue Don't worry if this sounds like a lot, we can help you get things set up properly.
- update the title of this PR to be in the format:
-
If this code is likely to affect the UI, did you name your branch with
-smoke
in it to trigger smoke tests? - If this is a new or updated feature, is there documentation for the new behavior?
- If this is new code, are there unit and/or integration tests?
- If this PR targets a
foundation-*
branch, does it try to avoid changing files in$OPENNMS_HOME/etc/
?
What's Next?
A PR should be assigned at least 2 reviewers. If you know that someone would be a good person to review your code, feel free to add them.
If you need help making additions or changes to the documentation related to your changes, please let us know.
In any case, if anything is unclear or you want help getting your PR ready for merge, please don't hesitate to say something in the comments here, or in the #opennms-development chat channel.
Once reviewer(s) accept the PR and the branch passes continuous integration, the PR is eligible for merge.
At that time, if you have commit access (are an OpenNMS Group employee or a member of the OGP) you are welcome to merge the PR when you're ready. Otherwise, a reviewer can merge it for you.
Thanks for taking time to contribute!
External References
- JIRA (Issue Tracker): http://issues.opennms.org/browse/${JIRA-ISSUE-NUMBER}