UT: Fix server stopping.

This commit is contained in:
Arthur Britto
2013-03-23 19:02:04 -07:00
parent deab548f1f
commit 7887ca1b05
2 changed files with 7 additions and 6 deletions

View File

@@ -192,7 +192,8 @@ Server.prototype.stop = function () {
if (!self.quiet) console.log("server: stop: server exited"); if (!self.quiet) console.log("server: stop: server exited");
self.emit('stopped'); self.emit('stopped');
delete this.child;
delete self.child;
}); });
this.child.kill(); this.child.kill();

View File

@@ -129,14 +129,14 @@ var build_teardown = function (host) {
.connect(false); .connect(false);
}, },
function stopServerStep(callback) { function stopServerStep(callback) {
if (opts.no_server) if (opts.no_server)
{ {
return callback();
}
return callback(); data.server
} .on('stopped', callback)
.stop();
data.server.on('stopped', callback).stop();
} }
], done); ], done);
}; };