Fixes the issue of missing root cause in container launch TimeoutException (e.g. SSLHandshakeException)
Fixes the issue of root causes not propagated to container launch TimeoutException; e.g. when applying a HttpWaitStrategy with TLS enabled (HTTPS), if HTTPS connection check fails because of certificate validation issue (e.g. javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target), this exception is not propagated, therefor missing from the logs and the TimeoutException thrown at the end. The only wait to know about it is by using a debugger. The fix just adds the causing exception to the ContainerLaunchException, so that it's part of the TimeoutException stacktrace later on.
Thanks for the PR @cdanger, a really good addition for the DX.
Could you please look into adding a test for this behavior? Maybe it is also fine to add it to the existing waitUntilReadyAndTimeout check, or maybe an additional test needs to be added.
Could you please look into adding a test for this behavior? Maybe it is also fine to add it to the existing
waitUntilReadyAndTimeoutcheck, or maybe an additional test needs to be added.
OK I added a new commit with a new test for this in the HttpWaitStrategyTest class: testWaitUntilReadyWithTimeoutCausedBySslHandshakeError() .
Waiting on code owner review...
@cdanger Do you want to finish up this PR regarding our suggestions, or should we take care of it?
@cdanger CI is failing because of spotless, can you please run ./gradlew :testcontainers:spotlessApply and commit the changes? 🙏
Thanks @cdanger, merged 👍