Make sure we don't hide exceptions from waitUntilContainerStarted#6167
Merged
eddumelendez merged 1 commit intotestcontainers:mainfrom Dec 14, 2022
Conversation
e9adc4f to
fd82b30
Compare
deejgregor
added a commit
to OpenNMS/opennms
that referenced
this pull request
Nov 13, 2022
See testcontainers/testcontainers-java#6167 This change should be temporary until the above fix is released and we update. Created waitUntilReadyWrapped to make it less messy to make this change now and revert it later.
deejgregor
added a commit
to OpenNMS/opennms
that referenced
this pull request
Nov 13, 2022
See testcontainers/testcontainers-java#6167 This change should be temporary until the above fix is released and we update. Created waitUntilReadyWrapped to make it less messy to make this change now and revert it later.
deejgregor
added a commit
to OpenNMS/opennms
that referenced
this pull request
Nov 13, 2022
See testcontainers/testcontainers-java#6167 This change should be temporary until the above fix is released and we update. Created waitUntilReadyWrapped to make it less messy to make this change now and revert it later.
deejgregor
added a commit
to OpenNMS/opennms
that referenced
this pull request
Nov 13, 2022
See testcontainers/testcontainers-java#6167 This change should be temporary until the above fix is released and we update. Created waitUntilReadyWrapped to make it less messy to make this change now and revert it later.
d23eaef to
10056f1
Compare
eddumelendez
requested changes
Nov 30, 2022
Member
eddumelendez
left a comment
There was a problem hiding this comment.
Thanks for your contribution @deejgregor ! I have left a suggestion which can be applied to the rest of messages.
10056f1 to
5c8af15
Compare
This adds the original exception as the cause. It also adds the text "Wait strategy threw an exception." to each exception message. This addresses two issues: 1. The original exception from waitUntilContainerStarted was not being included as the cause in newly thrown exceptions in tryStart. The exceptions were not completely hidden because they were being logged, however, but the initial cause was less visible. 2. The exception messages focused on state that was found at the time the exception was received but did not mention that the waitUntilContainerStarted method threw an exception. Because of these issues, unless you look at the source or see the logs, it isn't clear that this was caused by an exception from waitUntilContainerStarted. In systems that might highlight the failure message and stack trace and not logs/console output (test failure reports, CI systems, etc.), it makes it harder to debug these issues. Updated tests to check for the updated messages as well as the exception from waitUntilContainerStarted.
5c8af15 to
78d961c
Compare
eddumelendez
approved these changes
Dec 14, 2022
Member
|
thanks for your contribution @deejgregor ! This is now in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the original exception as the cause. It also adds the text "Wait strategy threw an exception." to each exception message.
This addresses two issues:
The original exception from waitUntilContainerStarted was not being included as the cause in newly thrown exceptions in tryStart. The exceptions were not completely hidden because they were being logged, however, but the initial cause was less visible.
The exception messages focused on state that was found at the time the exception was received but did not mention that the waitUntilContainerStarted method threw an exception.
Because of these two issues, unless you look at the source or see the logs, it isn't clear that this was caused by an exception from waitUntilContainerStarted. In test failure reports, CI systems, etc. that might highlight the failure message and not logs, this makes it harder to debug these issues.
Here is an example why including these details is useful:
test-results/junit/TEST-org.opennms.smoketest.OpenShiftCompatIT.xmlartifact if you search for the first instance ofERROR, but this is, uh, not the best user experience. ;-) https://app.circleci.com/pipelines/github/OpenNMS/opennms/25469/workflows/5af07488-d835-4b46-91e9-0bbb6ee70940/jobs/198804/artifacts