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

some small tweaks to #815, so that we don't use two differnt approaches for spawning redis

This commit is contained in:
Benjamin Coe
2015-09-03 22:51:25 -07:00
parent eb61ce32aa
commit d976bbcb2d
6 changed files with 16 additions and 7 deletions

View File

@@ -4,7 +4,7 @@ var redis = require('../../index');
var config = {
redis: redis,
PORT: 6378,
PORT: 6379,
HOST: {
IPv4: "127.0.0.1",
IPv6: "::1"

View File

@@ -11,6 +11,17 @@ module.exports = {
var confFile = conf || path.resolve(__dirname, '../conf/redis.conf');
var rp = cp.spawn("redis-server", [confFile], {});
// capture a failure booting redis, and give
// the user running the test some directions.
rp.once("exit", function (code) {
if (code !== 0) {
console.error('failed to starting redis with exit code "' + code + '" ' +
'stop any other redis processes currently running (' +
'hint: lsof -i :6379)');
process.exit(code)
}
})
// wait for redis to become available, by
// checking the port we bind on.
waitForRedis(true, function () {