From aae6d132e2cd343ee6a1e03dcd38677e3f22ad8f Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Sun, 14 Feb 2016 13:07:19 +0800 Subject: [PATCH] include full error output to aid diagnosis --- backtest.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backtest.js b/backtest.js index e4fc68f..0f8c7c2 100644 --- a/backtest.js +++ b/backtest.js @@ -110,10 +110,11 @@ if (process.argv.length > 2) { if (commits.length && running < nThreads) { var hash = commits.shift(); var task = child_process.fork('./backtest', { silent: true }); + var error = ''; setTimeout(function() { + error = 'task timed out\n'; task.kill(); - }, 15000); - var output = ''; + }, 20000); task.on('message', function(data) { if (data === 'ready') { ready = true; @@ -128,14 +129,14 @@ if (process.argv.length > 2) { fork(); }).on('exit', function(code) { if (code !== 0) { - console.error(hash, '-', output.substr(0, output.indexOf('\n'))); + console.error(hash, '-', error); done(); fork(); } }); task.stderr.setEncoding('utf8'); task.stderr.on('data', function(data) { - output += data; + error += data; }); task.stdout.resume(); task.send(hash); -- 2.34.1