Remote Docker caching errors - only first few tests run

You may be running into a Docker bootstrap race condition in your test suite. The test suite should not start until all necessary services are fully bootstrapped. Note that this typically includes more execution than simply starting up the containers. Some DB images create default databases and tables on container start. Selenium containers may require some time to start up the browser.

We suggest dockerize: https://github.com/jwilder/dockerize as a tool for managing container bootstrapping. The `-wait` subcommand will run commands on a sleep loop to test for bootstrap completion. You'll need to determine the appropriate commands to test that each container has fully bootstrapped.

Example: https://discuss.circleci.com/t/prevent-race-conditions-by-waiting-for-services-with-dockerize/11215

 

Another utility that might be useful is 'Wait Port': https://github.com/dwmkerr/wait-port

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.