-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow testcontainer to wait for a specific port #703
Conversation
*Motivation* A container might expose multiple ports for different purposes. for example, it can have a port for http endpoint, while having another port for grpc endpoint. So when doing a liveness check, it would be better to allow configuring checking a specific port, rather than checking the first exposed port. *Modification* Modify the `HttpWaitStrategy` to allow configuring the liveness port.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one, thanks!
Just a minor comment about the log level
Also, could you please add it to CHANGELOG.md
?
@@ -138,13 +157,18 @@ protected void waitUntilReady() { | |||
connection.setRequestMethod("GET"); | |||
connection.connect(); | |||
|
|||
log.info("Get response code {}", connection.getResponseCode()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change this (and Get response {}
) to .debug
or even .trace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bsideup thank you for review.
I changed the logging from INFO to TRACE and added an item to changelog.md.
Let me know if that looks better now :)
- add an item in CHANGELOG.md
@sijie merged, thanks! 👍 |
thank you @bsideup |
Motivation
A container might expose multiple ports for different purposes. for example, it can have a port for http endpoint,
while having another port for grpc endpoint. So when doing a liveness check, it would be better to allow configuring
checking a specific port, rather than checking the first exposed port.
Modification
Modify the
HttpWaitStrategy
to allow configuring the liveness port.