Repository navigation
Conversation
The test ran `apk add nmap-ncat` as the container command, so the package download from the Alpine mirror and ncat's ephemeral RSA key generation both counted against the 3s startup timeout of the wait strategy. A slow mirror made the HTTPS wait time out. Build the image (ncat, openssl and a self-signed cert) up front with ImageFromDockerfile so only the ncat listener starts within the timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015e4ZbWiZDuXFmb6UxExQJo
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
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.
Broken behaviour
HttpWaitStrategyTest.testWaitUntilReadyWithTlsAndAllowUnsecuresometimes fails onmainwith:Failing attempt, then a pass on the Develocity retry in the same job: core (17), run 45899380012 @ 943bfd28. Because of
failOnPassedAfterRetry = false, the job still showed green.Root cause
The container command was
apk add nmap-ncat; while true; do ... | ncat -lp 8080 --ssl; done. All of this ran inside the wait strategy's startup window, whichAbstractWaitStrategyTestcaps at 3 s (WAIT_TIMEOUT_MILLIS):apk addfetches the APKINDEX and the package fromdl-cdn.alpinelinux.orgat container start, so a slow mirror alone can use up the 3 s.--ssland no cert,ncatgenerates a temporary RSA key every time it starts, which adds more time on a busy shared runner.None of the other HTTP tests in this class install anything at runtime. They use busybox
nc, which is already in the image.Fix
Test-only change. The test now runs on a small
ImageFromDockerfileimage built fromalpine:3.17, whereRUNinstallsnmap-ncatandopenssland generates a self-signed cert at build time. The container then only startsncat --ssl --ssl-cert /cert.pem --ssl-key /key.pem, so the 3 s timeout covers just the listener. The test still checks the same behaviour (usingTls().allowInsecure()against a self-signed cert). Image builds happen beforewaitUntilReadyand aren't bounded by the startup timeout.Verification
./gradlew :testcontainers:checkstyleTest :testcontainers:compileTestJavapasses.spotlessApplycouldn't find Node in the sandbox where this was prepared.dl-cdn.alpinelinux.org(403), so neither the old nor the new version of this test can build or run there.testWaitUntilReadyWithTimeoutCausedBySslHandshakeErroralready doesapk addin a Dockerfile and fails there the same way. The other 11 tests in the class passed in 5 of 5 local runs. This PR is a draft until CI confirms the test passes.Context
Found by the automated weekly flaky-test report for
main(2026-11-23 to 2026-11-30): 306 CI jobs and about 15.7k test executions scanned. This was the #1 flake: 1 of 21 executions failed (4.8%) in environments where the class otherwise passes, and about 3.6 s plus a re-run were spent on the retry.Generated by Claude Code