You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
Add a test case for reconnect_select_db_after_pubsub
This commit is contained in:
21
test.js
21
test.js
@@ -516,6 +516,27 @@ tests.reconnect = function () {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tests.reconnect_select_db_after_pubsub = function() {
|
||||||
|
var name = "reconnect_select_db_after_pubsub";
|
||||||
|
|
||||||
|
client.select(test_db_num);
|
||||||
|
client.set(name, "one");
|
||||||
|
client.subscribe('ChannelV', function (err, res) {
|
||||||
|
client.stream.destroy();
|
||||||
|
});
|
||||||
|
|
||||||
|
client.on("reconnecting", function on_recon(params) {
|
||||||
|
client.on("ready", function on_connect() {
|
||||||
|
client.unsubscribe('ChannelV', function (err, res) {
|
||||||
|
client.get(name, require_string("one", name));
|
||||||
|
client.removeListener("connect", on_connect);
|
||||||
|
client.removeListener("reconnecting", on_recon);
|
||||||
|
next(name);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
tests.idle = function () {
|
tests.idle = function () {
|
||||||
var name = "idle";
|
var name = "idle";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user