Give it to yourself in the past, which is too clumsy.
--Cause 1. When running the test on the container, debugging etc. was performed while stopping the execution with binding pry
.
--Cause 2. Probably, ** the container is not stopped ** (it is stopped by binding pry), ** a new terminal is started and the test is executed again. ** **
--Cause 3. The containers are crowded, ** the state where multiple containers are trying to tamper with the table of the same DB due to the creation of test data etc. at the same timing **.
Image
――As a result, what was caused
Mysql2::Error::TimeoutError: Lock wait timeout exceeded
--Check the list of running and stopped containers with docker-compose ps
. Lots of undestroyed containers: scream:
--Delete the container with docker-compose kill target container
. (Alternatively, if the test was run with docker-compose run --rm rspec
etc., it will be automatically destroyed by docker-compose stop target container
)
Don't think you're too clumsy in the past, ** destroy the terminal without stopping the container and run the container in the new terminal. ** **