Wait#forListeningPort() / HostPortWaitStrategy waits for all exposed ports.
I am working with container which has several ports exposed, but some of them are bound conditionally, so cannot be used to check liveness.
Some containers accommodate such need by overriding getLivenessCheckPortNumbers.
|
public Set<Integer> getLivenessCheckPortNumbers() { |
|
return Sets.newHashSet(getMappedPort(REST)); |
Provide equivalent for custom containers using GenericContainer.
In my opinion it should be provided as a wait strategy (eg an extension to the existing HostPortWaitStrategy, or a separate one)
Wait#forListeningPort()/HostPortWaitStrategywaits for all exposed ports.I am working with container which has several ports exposed, but some of them are bound conditionally, so cannot be used to check liveness.
Some containers accommodate such need by overriding
getLivenessCheckPortNumbers.testcontainers-java/modules/couchbase/src/main/java/org/testcontainers/couchbase/CouchbaseContainer.java
Lines 119 to 120 in 4f6f2c7
Provide equivalent for custom containers using
GenericContainer.In my opinion it should be provided as a wait strategy (eg an extension to the existing
HostPortWaitStrategy, or a separate one)