Skip to content

Commit

Permalink
test: fix flaky test-http-regr-nodejsgh-2928
Browse files Browse the repository at this point in the history
Fix flaky test-http-regr-nodejsgh-2928 that has been failing on Raspberry Pi
devices in CI.

Fixes: nodejs#4830
  • Loading branch information
Trott committed Feb 9, 2016
1 parent dccccbb commit 7853b16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion test/sequential/sequential.status
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ prefix sequential

[$system==linux]
test-vm-syntax-error-stderr : PASS,FLAKY
test-http-regr-gh-2928 : PASS,FLAKY

[$system==macos]

Expand Down
11 changes: 5 additions & 6 deletions test/sequential/test-http-regr-gh-2928.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// 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');
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++)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7853b16

Please sign in to comment.