Skip to content
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

[Feature]: Expose class's fetch containerInfo timeout to user. #6128

Closed
GOODBOY008 opened this issue Nov 6, 2022 · 5 comments
Closed

[Feature]: Expose class's fetch containerInfo timeout to user. #6128

GOODBOY008 opened this issue Nov 6, 2022 · 5 comments

Comments

@GOODBOY008
Copy link

Module

Core

Problem

) KXEUHVA{152NEB`_BA830

Some conditions container will excute long time to expose ports , but currently only wait 5 seconds to fetch containerInfo.

Solution

Expose class's fetch containerInfo timeout to user and with defalt value.

Benefit

We can wait more time for heavy container to started.

Alternatives

None.

Would you like to help contributing this feature?

Yes

@GOODBOY008
Copy link
Author

Hi @kiview , Can you give me some advices? I'm waiting for your reply. Thank you~

@kiview
Copy link
Member

kiview commented Nov 7, 2022

@GOODBOY008 Can you please elaborate on your use case? This code is about container creation, it is independent of the ports becoming available (we have other code that checks for this condition).

Even heavy containers will have the actual container normally created in sub-seconds.

If you have a specific setup that is failing, sharing a reproducer would help:
https://github.com/testcontainers/testcontainers-java-repro

@GOODBOY008
Copy link
Author

@kiview Thanks for your reply , I have create a repo to reproduce my sceno. https://github.com/GOODBOY008/testcontainer-issue/tree/issue-6128 .

@eddumelendez
Copy link
Member

eddumelendez commented Nov 8, 2022

Hi @GOODBOY008! thanks for sharing! the issue is related to the host mode. I use the the following code

    private Network network = Network.newNetwork();

    @Test
    public void demonstration() {

        try (
                GenericContainer<?> OB_SERVER =
                        new GenericContainer<>("oceanbase/oceanbase-ce:3.1.4")
                                .withNetwork(network)
                                .withExposedPorts(OB_SERVER_SQL_PORT, OB_SERVER_RPC_PORT)
                                .withEnv("OB_ROOT_PASSWORD", OB_SYS_PASSWORD)
                                .waitingFor(Wait.forLogMessage(".*boot success!.*", 1))
                                .withLogConsumer(new Slf4jLogConsumer(LOG));
                GenericContainer<?> LOG_PROXY =
                        new GenericContainer<>("whhe/oblogproxy:1.0.3")
                                .withNetwork(network)
                                .withExposedPorts(LOG_PROXY_PORT)
                                .withEnv("OB_SYS_USERNAME", OB_SYS_USERNAME)
                                .withEnv("OB_SYS_PASSWORD", OB_SYS_PASSWORD)
                                .waitingFor(Wait.forLogMessage(".*boot success!.*", 1))
                                .withLogConsumer(new Slf4jLogConsumer(LOG));
        ) {
            Startables.deepStart(Stream.of(OB_SERVER, LOG_PROXY)).join();
        }
    }

and it worked. is it helps? Otherwise, I think you can follow #5151 due to this is duplicated.

@GOODBOY008
Copy link
Author

@eddumelendez Thanks , it's worked.

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

No branches or pull requests

3 participants