Browse Source

bla

fix-windows-spawn
Ruben Bridgewater 9 years ago
parent
commit
1c7c6dbdf1
  1. 38
      test/lib/redis-process.js

38
test/lib/redis-process.js

@ -54,24 +54,26 @@ module.exports = {
confFile = confFile.replace('.conf', '.win32.conf'); confFile = confFile.replace('.conf', '.win32.conf');
redis = 'redis-64\\tools\\redis-server.exe'; redis = 'redis-64\\tools\\redis-server.exe';
} }
var rp = spawn.sync(redis, [confFile], { stdio: 'inherit' }); var rp = spawn(redis, [confFile], { stdio: 'inherit' });
done(null, { waitForRedis(true, function () {
spawnFailed: function () { done(null, {
return false; // Remove if as soon as it's not necessary anymore spawnFailed: function () {
}, return false; // Remove if as soon as it's not necessary anymore
stop: function (done) { },
rp.once('exit', function (code) { stop: function (done) {
var error = null; rp.once('exit', function (code) {
if (code !== null && code !== 0) { var error = null;
error = new Error('Redis shutdown failed with code ' + code); if (code !== null && code !== 0) {
} error = new Error('Redis shutdown failed with code ' + code);
waitForRedis(false, function () { }
return done(error); waitForRedis(false, function () {
}, port); return done(error);
}); }, port);
rp.kill('SIGTERM'); });
} rp.kill('SIGTERM');
}); }
});
}, port);
} }
}; };

Loading…
Cancel
Save