You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Fix some tests
This commit is contained in:
@@ -3,15 +3,15 @@
|
||||
// as soon as there are no outstanding commands.
|
||||
'use strict';
|
||||
|
||||
var redis = require("../../");
|
||||
var redis = require("../../index");
|
||||
var HOST = process.argv[2] || '127.0.0.1';
|
||||
var PORT = process.argv[3];
|
||||
var args = PORT ? [PORT, HOST] : [HOST];
|
||||
|
||||
var c = redis.createClient.apply(redis, args);
|
||||
c.unref();
|
||||
c.info(function (err, reply) {
|
||||
if (err) process.exit(-1);
|
||||
if (!reply.length) process.exit(-1);
|
||||
process.stdout.write(reply.length.toString());
|
||||
});
|
||||
c.unref();
|
||||
|
@@ -416,12 +416,14 @@ describe("The node_redis client", function () {
|
||||
|
||||
describe('unref', function () {
|
||||
it('exits subprocess as soon as final command is processed', function (done) {
|
||||
this.timeout(12000);
|
||||
var args = config.HOST[ip] ? [config.HOST[ip], config.PORT] : [ip];
|
||||
var external = fork("./test/lib/unref.js", args);
|
||||
|
||||
var id = setTimeout(function () {
|
||||
external.kill();
|
||||
return done(Error('unref subprocess timed out'));
|
||||
}, 5000);
|
||||
}, 8000);
|
||||
|
||||
external.on("close", function (code) {
|
||||
clearTimeout(id);
|
||||
@@ -555,7 +557,7 @@ describe("The node_redis client", function () {
|
||||
} else {
|
||||
client.end();
|
||||
var lasted = new Date().getTime() - time;
|
||||
assert.ok(lasted < 50);
|
||||
assert.ok(lasted < 100);
|
||||
return done();
|
||||
}
|
||||
});
|
||||
|
@@ -147,7 +147,7 @@ describe("publish/subscribe", function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('handles SUB_UNSUB_MSG_SUB', function (done) {
|
||||
it('handles SUB_UNSUB_MSG_SUB 2', function (done) {
|
||||
helper.serverVersionAtLeast.bind(this)(sub, [2, 6, 11]);
|
||||
|
||||
sub.psubscribe('abc*');
|
||||
|
Reference in New Issue
Block a user