diff --git a/lib/redis/connection.js b/lib/redis/connection.js index 59714ecb..bbf3fa74 100644 --- a/lib/redis/connection.js +++ b/lib/redis/connection.js @@ -68,7 +68,9 @@ module.exports = (log, client) => { .then(result => { isUpdating = false if (! result) { - log.error({ op: 'redis.watch.conflict', key }) + // Really this isn't an error as such, it just indicates that + // this function is operating sanely in concurrent conditions. + log.warn({ op: 'redis.watch.conflict', key }) throw error.unexpectedError() } }) diff --git a/test/local/redis/connection.js b/test/local/redis/connection.js index f5fbb91e..2411e5ae 100644 --- a/test/local/redis/connection.js +++ b/test/local/redis/connection.js @@ -490,10 +490,11 @@ describe('redis/connection:', () => { assert.equal(redisMulti.execAsync.callCount, 1) }) - it('called log.error correctly', () => { - assert.equal(log.error.callCount, 1) - assert.equal(log.error.args[0].length, 1) - assert.deepEqual(log.error.args[0][0], { + it('called log.warn correctly', () => { + assert.equal(log.error.callCount, 0) + assert.equal(log.warn.callCount, 1) + assert.equal(log.warn.args[0].length, 1) + assert.deepEqual(log.warn.args[0][0], { op: 'redis.watch.conflict', key: 'wibble' }) diff --git a/test/remote/redis_tests.js b/test/remote/redis_tests.js index f073a364..5919b8d4 100644 --- a/test/remote/redis_tests.js +++ b/test/remote/redis_tests.js @@ -10,7 +10,7 @@ const assert = require('insist') const config = require(`${ROOT_DIR}/config`).getProperties() const P = require(`${ROOT_DIR}/lib/promise`) -const log = { info () {}, error () {} } +const log = { info () {}, warn () {}, error () {} } const redis = require(`${ROOT_DIR}/lib/redis`)(Object.assign({}, config.redis, { enabled: true }), log)