1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

Fix race condition in tests

This commit is contained in:
Ruben Bridgewater
2015-10-11 03:31:09 +02:00
parent 8c0d11361a
commit e0b9f0de79
52 changed files with 60 additions and 60 deletions

View File

@@ -15,7 +15,7 @@ describe("The 'blpop' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -23,7 +23,7 @@ describe("The 'dbsize' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.quit();
});
client.on('end', function () {
@@ -44,7 +44,7 @@ describe("The 'dbsize' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(function (err, res) {
helper.isString("OK")(err, res);
done();

View File

@@ -13,7 +13,7 @@ describe("The 'del' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -16,7 +16,7 @@ describe("The 'eval' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -13,7 +13,7 @@ describe("The 'exits' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -13,7 +13,7 @@ describe("The 'expire' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -23,7 +23,7 @@ describe("The 'flushdb' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.quit();
});
client.on('end', function () {
@@ -44,7 +44,7 @@ describe("The 'flushdb' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
done();
});
});

View File

@@ -13,7 +13,7 @@ describe("The 'geoadd' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -23,7 +23,7 @@ describe("The 'get' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.quit();
});
client.on('end', function () {
@@ -44,7 +44,7 @@ describe("The 'get' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
done();
});
});

View File

@@ -24,7 +24,7 @@ describe("The 'getset' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.quit();
});
client.on('end', function () {
@@ -46,7 +46,7 @@ describe("The 'getset' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
done();
});
});

View File

@@ -16,7 +16,7 @@ describe("The 'hgetall' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});
@@ -57,7 +57,7 @@ describe("The 'hgetall' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'hincrby' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -13,7 +13,7 @@ describe("The 'hlen' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -16,7 +16,7 @@ describe("The 'hmget' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("error", done);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb();
client.HMSET(hash, {"0123456789": "abcdefghij", "some manner of key": "a type of value"}, helper.isString('OK', done));
});

View File

@@ -15,7 +15,7 @@ describe("The 'hmset' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -15,7 +15,7 @@ describe("The 'hset' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -17,7 +17,7 @@ describe("The 'incr' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.set(key, "9007199254740992", function (err, res) {
helper.isNotError()(err, res);
client.quit();
@@ -55,7 +55,7 @@ describe("The 'incr' method", function () {
*/
client = redis.createClient.apply(redis.createClient, args);
client.once("error", done);
client.once("connect", function () {
client.once("ready", function () {
client.set(key, "9007199254740992", function (err, res) {
helper.isNotError()(err, res);
done();

View File

@@ -18,7 +18,7 @@ describe("The 'keys' method", function () {
// This is going to test if the high water is also respected
args.command_queue_high_water = 100;
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -15,7 +15,7 @@ describe("The 'mget' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("error", done);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb();
client.mset(["mget keys 1", "mget val 1", "mget keys 2", "mget val 2", "mget keys 3", "mget val 3"], done);
});

View File

@@ -25,7 +25,7 @@ describe("The 'mset' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.quit();
});
client.on('end', function () {
@@ -46,7 +46,7 @@ describe("The 'mset' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
done();
});
});

View File

@@ -13,7 +13,7 @@ describe("The 'msetnx' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -23,7 +23,7 @@ describe("The 'multi' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.quit();
});
client.on('end', function () {

View File

@@ -14,7 +14,7 @@ describe("The 'randomkey' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -13,7 +13,7 @@ describe("The 'rename' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -13,7 +13,7 @@ describe("The 'renamenx' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'rpush' command", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'sadd' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -13,7 +13,7 @@ describe("The 'scard' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -17,7 +17,7 @@ describe("The 'script' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'sdiff' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'sdiffstore' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -15,7 +15,7 @@ describe("The 'select' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.quit();
});
client.on('end', function () {

View File

@@ -23,7 +23,7 @@ describe("The 'set' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.quit();
});
client.on('end', function () {
@@ -44,7 +44,7 @@ describe("The 'set' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
done();
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'setex' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -13,7 +13,7 @@ describe("The 'setnx' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'sinter' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'sinterstore' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -13,7 +13,7 @@ describe("The 'sismember' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'slowlog' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'smembers' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -13,7 +13,7 @@ describe("The 'smove' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'spop' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'srem' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'sunion' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'sunionstore' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe.skip("The 'sync' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'ttl' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -13,7 +13,7 @@ describe("The 'type' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -16,7 +16,7 @@ describe("The 'watch' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'zadd' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});

View File

@@ -14,7 +14,7 @@ describe("The 'zscore' method", function () {
beforeEach(function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.once("connect", function () {
client.once("ready", function () {
client.flushdb(done);
});
});