TestContainers doc states
Ordinarily Testcontainers will wait for up to 60 seconds for the container's first mapped network port to start listening.
This simple measure provides a basic check whether a container is ready for use.
If I am starting my container like below
var sharedKafkaContainer = new KafkaContainer(DockerImageName.parse(DOCKER_KAFKA_IMAGE_NAME));
sharedKafkaContainer.withStartupTimeout(Duration.of(3, ChronoUnit.MINUTES));
Then the container will wait for 3 mins for the exposed or mapped port to start listening.
The below code is a succinct representation of the above and there is no difference between withStartupTimeout and waitingFor(Wait.forListeningPort()) Is my understanding correct?
var sharedKafkaContainer = new KafkaContainer(DockerImageName.parse(DOCKER_KAFKA_IMAGE_NAME));
sharedKafkaContainer.withStartupTimeout(Duration.of(3, ChronoUnit.MINUTES));
sharedKafkaContainer.waitingFor(Wait.forListeningPort()).start()