From 8b99e2d97f18eeeef5127d92dbf2161546ab8110 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 8 Feb 2016 21:26:10 -0800 Subject: [PATCH] test: fix flaky test-http-regr-gh-2928 Fix flaky test-http-regr-gh-2928 that has been failing on Raspberry Pi devices in CI. Fixes: https://github.com/nodejs/node/issues/4830 PR-URL: https://github.com/nodejs/node/pull/5154 Reviewed-By: James M Snell Reviewed-By: Rod Vagg Reviewed-By: Ben Noordhuis --- test/sequential/sequential.status | 1 - test/sequential/test-http-regr-gh-2928.js | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/test/sequential/sequential.status b/test/sequential/sequential.status index 84760b9c72..ddf864ea40 100644 --- a/test/sequential/sequential.status +++ b/test/sequential/sequential.status @@ -10,7 +10,6 @@ prefix sequential [$system==linux] test-vm-syntax-error-stderr : PASS,FLAKY -test-http-regr-gh-2928 : PASS,FLAKY [$system==macos] diff --git a/test/sequential/test-http-regr-gh-2928.js b/test/sequential/test-http-regr-gh-2928.js index 92cfd9ca35..975eb84e76 100644 --- a/test/sequential/test-http-regr-gh-2928.js +++ b/test/sequential/test-http-regr-gh-2928.js @@ -1,3 +1,6 @@ +// This test is designed to fail with a segmentation fault in Node.js 4.1.0 and +// execute without issues in Node.js 4.1.1 and up. + 'use strict'; const common = require('../common'); const assert = require('assert'); @@ -5,8 +8,7 @@ const httpCommon = require('_http_common'); const HTTPParser = process.binding('http_parser').HTTPParser; const net = require('net'); -const PARALLEL = 30; -const COUNT = httpCommon.parsers.max + 100; +const COUNT = httpCommon.parsers.max + 1; const parsers = new Array(COUNT); for (var i = 0; i < parsers.length; i++) @@ -41,10 +43,7 @@ var server = net.createServer(function(c) { c.end('HTTP/1.1 200 OK\r\n\r\n', function() { c.destroySoon(); }); -}).listen(common.PORT, function() { - for (var i = 0; i < PARALLEL; i++) - execAndClose(); -}); +}).listen(common.PORT, execAndClose); process.on('exit', function() { assert.equal(gotResponses, COUNT);