-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Shorten fallback to another strategy #4386
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
Conversation
When a strategy chosen based on the configuration failed, there should be no point in checking it again based on the list of all available strategies.
| .peek(strategy -> log.info("Loaded {} from ~/.testcontainers.properties, will try it first", strategy.getClass().getName())), | ||
| strategies | ||
| .stream() | ||
| .filter(c -> !c.getClass().getCanonicalName().equals(TestcontainersConfiguration.getInstance().getDockerClientStrategyClassName())) |
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.
| .filter(c -> !c.getClass().getCanonicalName().equals(TestcontainersConfiguration.getInstance().getDockerClientStrategyClassName())) | |
| .filter(it -> !it.getClass().getCanonicalName().equals(TestcontainersConfiguration.getInstance().getDockerClientStrategyClassName())) |
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.
Also, please extract TestcontainersConfiguration.getInstance().getDockerClientStrategyClassName() variable - used in two places (see Stream.of)
| Info info; | ||
| try { | ||
| info = Unreliables.retryUntilSuccess(30, TimeUnit.SECONDS, () -> { | ||
| info = Unreliables.retryUntilSuccess(5, TimeUnit.SECONDS, () -> { |
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.
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.
This may not be a bad idea, actually 👍
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.
Perhaps, besides making the default timeout much shorter, we could also make it configurable (again)? So for people who need different TO (due to whatever reason) the would be an option?
It's about two things: