Redis flakiness


#1

Using CircleCI 2.0, Redis appears to randomly fail to start properly. We get this:

Redis::CannotConnectError:
Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)

Sometimes tests would pass (redis starts OK), sometimes they fail with this error. It seems to be completely random. Has anyone encountered this and if so, is there a workaround or fix?

Thanks.


#2

It’s probably a race condition where Redis isn’t fully up yet.


#3

Do you have a recommendation to avoid the race condition? Some kind of wait/sleep?


#4

Our senior dev has specifically tried to resolve this issue with the suggestion from this previous discussion:

Redis was still intermittent afterwards.


#5

https://circleci.com/docs/2.0/postgres-config/#using-dockerize

Using Dockerize and --wait solved this issue for us.


#6

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.