test: fix flaky test-http-regr-gh-2928
authorRich Trott <rtrott@gmail.com>
Tue, 9 Feb 2016 05:26:10 +0000 (21:26 -0800)
committerMyles Borins <mborins@us.ibm.com>
Wed, 2 Mar 2016 22:01:11 +0000 (14:01 -0800)
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 <jasnell@gmail.com>
Reviewed-By: Rod Vagg <r@va.gg>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
test/sequential/sequential.status
test/sequential/test-http-regr-gh-2928.js

index 84760b9c720653c1be92a56348dd0664b0c3d537..ddf864ea4073c4dd99760e9ff3dbf7add9659b59 100644 (file)
@@ -10,7 +10,6 @@ prefix sequential
 
 [$system==linux]
 test-vm-syntax-error-stderr : PASS,FLAKY
-test-http-regr-gh-2928      : PASS,FLAKY
 
 [$system==macos]
 
index 92cfd9ca356d468d3f547d537fa675a20cfe5feb..975eb84e769d97109582a575854e0bfc782627e6 100644 (file)
@@ -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);