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
Trying to reuse container - shut down in the end #2352
Comments
you have Consider removing it and either manually triggering |
OK. Will try that. The problem is that I want it to be reused in my dev. env. (having that config in Is this thing possible? |
Testcontainers will stop it automatically after the tests when environment is not in the reuse mode, no need to worry :) |
OK. Then I guess this should work:
|
@bojanv55 that's correct. And you don't need the |
Yes. It is there just to put comment on it with description. Also, I saw in doucumentation on main website, you use |
@bojanv55 we're working on a new DSL that will eliminate the need to do these nasty generics :) Stay tuned! |
@bsideup Is this "stopping the container after each test" happening even if I use the @container on a static field, like this?
|
@brneto Yes. These annotations take care of both starting and stopping. |
@bsideup Ok! Thanks a lot! Just one more thing! When I use the singleton container approach it works but I loose the test container start up logs. Is there any way to I have those logs back even using the singleton approach? |
Due to the issue testcontainers/testcontainers-java#2352 MysqlTestContainer class has been refactored to avoid the start up of one different container for each test.
Due to the issue testcontainers/testcontainers-java#2352 PostgresTestContainer class had been refactored to stop the creation of a new container before each test.
I'm trying to reuse container, using this config:
The problem is that on each run I get
"Can't find a reusable running container with hash: 6a8b6aa299e529bb2a649319168324794464ee26"
and then on next run again same message.Other MySQL container works OK (reusable) on my machine. Using latest 1.12.4 and JUNIT 5. Executed also
echo "testcontainers.reuse.enable=true" > ~/.testcontainers.properties
so it should work I guess.The text was updated successfully, but these errors were encountered: