From 14b63f74071ab97275a776f54358d888320f9b10 Mon Sep 17 00:00:00 2001 From: Stefan Thomas Date: Thu, 10 Jan 2013 15:57:09 +0100 Subject: [PATCH] Tests: Print an error when timing out due to server crash. --- test/server.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/test/server.js b/test/server.js index 8606c003bd..84d5164b46 100644 --- a/test/server.js +++ b/test/server.js @@ -98,12 +98,19 @@ Server.prototype._serverSpawnSync = function() { // By default, just log exits. 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 not called "stop". + // Workaround for + // https://github.com/busterjs/buster/issues/266 + if (!self.stopping) { + buster.assertions.throwOnFailure = true; + } - if (!self.quiet) console.log("server: spawn: server exited code=%s: signal=%s", code, signal); - }); + // If could not exec: code=127, signal=null + // If regular exit: code=0, signal=null + // Fail the test if the server has not called "stop". + buster.assert(self.stopping, 'Server died with signal '+signal); + + if (!self.quiet) console.log("server: spawn: server exited code=%s: signal=%s", code, signal); + }); }; // Prepare server's working directory.