| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Reduce resoures required by test. Clarify comment explaining source of test and what the test is looking for. Fixes: nodejs#5725
|
Stress test showing flakiness on current master: https://ci.nodejs.org/job/node-stress-single-test/560/nodes=pi2-raspbian-wheezy/console |
Sorry, something went wrong.
|
For context: Here's a gist from @mikeal who originally reported the bug: https://gist.githubusercontent.com/mikeal/864727/raw/561f3b665df0faff6d3ee9601ef31cc3caf0376f/gistfile1.js That code fails on Node.js 0.6.0 and succeeds in 0.6.21. If we change it to this, it still failsin Node.js 0.6.0 and succeeds in 0.6.21: var http = require('http');
var fs = require('fs');
var parseUrl = require('url').parse;
http.globalAgent.maxSockets = 1;
var i = 10;
while(i > 0) {
(function () {
var x = i;
var u = parseUrl("http://farm4.static.flickr.com/3557/3670453345_c38d482efb_m.jpg")
var c = http.request(
{ host:u.hostname
, port:u.port
, method: 'GET'
, path: u.pathname
, headers: {host:u.hostname}
}
, function (res) {
console.log(x)
res.pipe(fs.createWriteStream(x + ".jpg"))
})
c.end();
i--;
})()
}
The key is that http.globalAgent.maxSockets needs to be less than i to trip the bug. So, that's why we are able to reduce the number of sockets in this test the way we do in this PR. |
Sorry, something went wrong.
|
Stress test to hopefully show that this is not flaky. Hope I didn't typo in the parameters... https://ci.nodejs.org/job/node-stress-single-test/563/nodes=pi2-raspbian-wheezy/console |
Sorry, something went wrong.
|
Bump. /cc @nodejs/testing |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Pull Request check-list
Please make sure to review and check all of these items:
this change (including linting)?
test (or a benchmark) included?
existing APIs, or introduces new ones)?
Affected core subsystem(s)
test, http
Description of change
Reduce resoures required by test. Fixes test flakiness on Raspberry Pi in CI.
Clarify comment explaining source of test and what the test is looking
for.
Fixes: #5725