From 37c073a79b9d7c43caacdca7a26ed327e6db912d Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Thu, 20 Dec 2012 22:06:16 -0800 Subject: [PATCH] UT: Fix reporting of errors on server exit. --- test/server.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/server.js b/test/server.js index 9fecec2f7a..8606c003bd 100644 --- a/test/server.js +++ b/test/server.js @@ -100,7 +100,8 @@ Server.prototype._serverSpawnSync = function() { this.child.on('exit', function(code, signal) { // If could not exec: code=127, signal=null // If regular exit: code=0, signal=null - buster.assert(!self.stopping); //Fail the test if the server has called "stop" + buster.assert(self.stopping); //Fail the test if the server has not called "stop". + if (!self.quiet) console.log("server: spawn: server exited code=%s: signal=%s", code, signal); }); }; @@ -150,7 +151,9 @@ Server.prototype.start = function () { // Stop a standalone server. Server.prototype.stop = function () { var self = this; + self.stopping = true; + if (this.child) { // Update the on exit to invoke done. this.child.on('exit', function (code, signal) {