-
-
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
wait until container started - doesn't end and in the meantime creates multiple containers (MySQLContainer) #511
Comments
Hi @ori-n, can you please share a more complete example of your code? |
Below is the complete function - I'm using junit
|
Can't reproduce this behavior on Docker for Windows. Are both containers removed once the tests have finished? |
I tried both win and linux. It simply gets stuck. Did you try the exact code? Maybe i can try to change the code.
The mysql I use is base on alpine
Thanks,
Ori
…________________________________
From: Kevin Wittek <[email protected]>
Sent: Friday, December 8, 2017 1:07:30 AM
To: testcontainers/testcontainers-java
Cc: ori-n; Mention
Subject: Re: [testcontainers/testcontainers-java] wait until container started - doesn't end and in the meantime creates multiple containers (#511)
Can't reproduce this behavior on Docker for Windows. Are both containers removed once the tests have finished?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#511 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AfvrAAi37cZRNg7JVwykhhVY5GIh9S6Eks5s-G-ygaJpZM4Q2brs>.
|
I tried your exakt code on the current master branch of testcontainers and it works as expected. How is it possible for your Did you override your local |
Sorry. Alpine before was a mistake. I did not override
Thanks,
Ori
…________________________________
From: Kevin Wittek <[email protected]>
Sent: Friday, December 8, 2017 10:55:39 AM
To: testcontainers/testcontainers-java
Cc: ori-n; Mention
Subject: Re: [testcontainers/testcontainers-java] wait until container started - doesn't end and in the meantime creates multiple containers (#511)
I tried your exakt code on the current master branch of testcontainers and it works as expected.
How is it possible for your MySQLContainer to be alpine based? If you don't specify any constructor paramters, the container will use mysql:latest, which is Debian based (see https://hub.docker.com/_/mysql/).
Did you override your local mysql:latest manually on your system?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#511 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AfvrADSq_Yzk3U7soyaLXUwIzJoWTkeoks5s-PmLgaJpZM4Q2brs>.
|
Can you maybe upload a complete example project on Github? |
@kiview |
@pol12va |
@kiview |
I fixed this by adding the mysql connector dependency to my test. |
Adding mysql connector made it work for |
The problem with MySQL 8 could be because of the different authentication scheme introduced in MySQL 8. This is likely the same problem as issue #736. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this. |
The spawning of multiple containers may be fixed by #1433 |
If you manually connect to the container's DB, while it's "waiting for database connection to become available", the loop resumes. This is just a hint on what may be wrong, not a workaround. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this. |
I tried this simple code:
try (MySQLContainer mySQLContainer = new MySQLContainer()) { mySQLContainer.start(); mySQLContainer.stop(); }
In the log I get:
[INFO] 2017-12-05 16:50:48,709 [main] 🐳 [mysql:latest] waitUntilContainerStarted - Waiting for database connection to become available at jdbc:mysql://localhost:32770/test using query 'SELECT 1'
And in the meantime containers are created every 2 min:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
7504e73de3d5 mysql:latest "docker-entrypoint..." 11 minutes ago Up 11 minutes 0.0.0.0:32770->3306/tcp
1ae62c3a699c mysql:latest "docker-entrypoint..." 13 minutes ago Up 13 minutes 0.0.0.0:32769->3306/tcp
Am I doing something wrong. Tries both on docker on windows and docker on ubuntu and got the same results
The text was updated successfully, but these errors were encountered: