-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
The cleanup is missing between the startup attempts #2877
Comments
After looking at the issue, I get a feeling that I've changed the scope of the issue to a broader one, about the startup attempts 👍 |
We appear to be running into this issue. In case many tests fail to bring up their browser, we end up with many docker containers using up resources. This in turn causes our ephemeral docker host to grind to a halt. As this failure mode is slow, the feedback we get is quite delayed and the follow-up errors due to the resource starved environment further muddy the water. Of course the problem only occurs if something goes wrong. Unfortunately we're in the process of migrating to testcontainers, so the number of known configuration problems is not zero yet. This behaviour didn't exactly help us quickly iron out the remaining issues. Our work-around: We override
|
When
BrowserWebDriverContainer#containerIsStarted()
fails to construct the WebDriver object, TC tries to restart it, up to 3 times, leading to several containers running.This is because
GenericContainer#doStart()
does:And BrowserWebDriverContainer has a retry set to 3 (see https://github.com/testcontainers/testcontainers-java/blob/master/modules/selenium/src/main/java/org/testcontainers/containers/BrowserWebDriverContainer.java#L191).
So if
containerIsStarted()
fails thentryStart()
fails and thus it's called again.Leading to seeing the following for example, where you can see 2 BrowserWebDriverContainer containers:
It could be better that TC stops it before it retries to start it to use less resource on the machine. TBH I don't know how much of it is a problem but it seems not right somehow.
WDYT?
Thanks
The text was updated successfully, but these errors were encountered: