Created by: doublerebel
Hello,
This PR changes the redis dependency from node_redis to ioredis, fixing #185 (closed) (and completing PR #188). ioredis uses promises "all-the-way-down", exposing errors in the test suite. These tests are fixed and passing, including the race condition described in #370 (closed).
There are several commits here, to demonstrate the bugs and fixes made to the test suite. I am happy to squash this down, but right now each commit contains a description of the issues solved with the updated tests.
As part of solving #370 (closed), node-redlock is now used to implement atomic locking with a guaranteed owner. node-redlock is a promise-based lib which keeps track of its own secret token/value for each job/resource, which makes node-redlock valuable whether or not it's used with redis clustering.
Thanks for your work, looking forward to your feedback.