Just joined CircleCI yesterday to trial before we get a couple of servers to do full scale testing. We don’t have much customization when it comes to our app. We use Elasticsearch and Redis along with Sidekiq 4.
App Details:
Ruby 2.2.2
Rails 4.2
Issue:
Here is my issue. Most of the time when we fire up a test in Circle it fails because it can’t find the Redis server (Please See Pics). It works maybe 1 out of 10.
Local Box:
Tests run fine
Troubleshooting:
I placed a test to see if the redis is running when our tests start to run but it doesn’t detect that the Redis server is running. Am I configuring something wrong or is this possibly a bug?
@MatthewSuttles thanks for the solution, I think a better approach may be to just have a script that checks to make sure redis is running and if not start it up before running the tests. This will prevent the overhead of having to install redis each time.
For example, you can have a script called wait-for-redis.sh
until bash -c "sudo service redis-server status"; do
>&2 echo "Redis not running, trying to kick start it"
bash -c "sudo service redis-server start"
sleep 1
done