feat: add dynamic port resolution for WaitForHttp#46
Merged
shyim merged 6 commits intotestcontainers:mainfrom Dec 27, 2025
Merged
feat: add dynamic port resolution for WaitForHttp#46shyim merged 6 commits intotestcontainers:mainfrom
shyim merged 6 commits intotestcontainers:mainfrom
Conversation
Collaborator
Author
|
Hi @rw4lll, Thanks for the info. I've given it some more thought. If you don't pass a port to WaitForHttp, it works for the first port. In our case, we want to refer to a specific port in WaitForHttp, as there may be more than one. In this case, the resolvePort method no longer works. I have revised it again and hope that it is now easier to read for our problem. I have also added another test to check the firstMappedPort and MappedPort for the two variants with WaitForHttp. |
Author
shyim
approved these changes
Dec 27, 2025
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.
Hi,
WaitForHttp is runs outside the container and cannot access the internal port if it differs from the external port. With this solution, the external dynamic port is resolved via the specified internal port.
integration + cs + phpstan was executed successfully before the PR