From a09c6268a2790ba216bac4fde4116373ee49281d Mon Sep 17 00:00:00 2001 From: Spencer Alger Date: Fri, 7 Feb 2014 13:39:01 -0700 Subject: [PATCH] on node 0.8 cp.fork does not let the process die when the event loop is empty --- test/unit/specs/http_connector.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/specs/http_connector.js b/test/unit/specs/http_connector.js index 12fe8d076..4059638c9 100644 --- a/test/unit/specs/http_connector.js +++ b/test/unit/specs/http_connector.js @@ -376,7 +376,7 @@ describe('Http Connector', function () { var path = require('path'); var es = require('event-stream'); - var proc = cp.fork(path.join(__dirname, '../../fixtures/keepalive.js'), { + var proc = cp.spawn('node', [path.join(__dirname, '../../fixtures/keepalive.js')], { silent: true }); @@ -385,7 +385,7 @@ describe('Http Connector', function () { proc.stderr ).pipe(es.wait(function (err, output) { expect(err).to.eql(null); - expect(output.trim()).to.eql('1'); + expect(parseInt(output.trim(), 10) <= 1).to.be.ok(); done(); })); });