Skip to content

[Documentation Request] Wait for Port #476

Closed

Description

@bearrito

I did not see this addressed in the documentation. What port does the Wait methods use?

Activity

  1. bearrito commented on Oct 23, 2017

    @bearrito
    Author

    I think this can be closed I dug through the src and saw the following

     protected Integer getLivenessCheckPort() {
            if (exposedPorts.size() > 0) {
                return getMappedPort(exposedPorts.get(0));
            } else if (portBindings.size() > 0) {
                return Integer.valueOf(PortBinding.parse(portBindings.get(0)).getBinding().getHostPortSpec());
            } else {
                return null;
            }
        }
    

    It seems that the answer is : The first port among exposed ports.

  2. bsideup commented on Nov 6, 2017

    @bsideup
    Member

    Hi @bearrito,

    It's mentioned in the docs ( https://www.testcontainers.org/usage/options.html#customizing-the-container ):

    Ordinarily Testcontainers will wait for up to 60 seconds for the container's first mapped network port to start listening.

    Do you think we need to be more explicit or it is fine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions