Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a77dcfe

Browse filesBrowse files
TrottMyles Borins
authored andcommitted
test: use platform-based timeout for reliability
test-http-client-timeout-with-data fails on Raspberry Pi in CI from time to time. Use a platform-based timeout to improve reliability. PR-URL: #4015 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Roman Reiss <me@silverwind.io>
1 parent a320045 commit a77dcfe
Copy full SHA for a77dcfe

File tree

Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-http-client-timeout-with-data.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-client-timeout-with-data.js
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
4-
var http = require('http');
2+
const common = require('../common');
3+
const assert = require('assert');
4+
const http = require('http');
55

66
var ntimeouts = 0;
77
var nchunks = 0;
@@ -11,21 +11,21 @@ process.on('exit', function() {
1111
assert.equal(nchunks, 2);
1212
});
1313

14-
var options = {
14+
const options = {
1515
method: 'GET',
1616
port: common.PORT,
1717
host: '127.0.0.1',
1818
path: '/'
1919
};
2020

21-
var server = http.createServer(function(req, res) {
21+
const server = http.createServer(function(req, res) {
2222
res.writeHead(200, {'Content-Length':'2'});
2323
res.write('*');
24-
setTimeout(function() { res.end('*'); }, 100);
24+
setTimeout(function() { res.end('*'); }, common.platformTimeout(100));
2525
});
2626

2727
server.listen(options.port, options.host, function() {
28-
var req = http.request(options, onresponse);
28+
const req = http.request(options, onresponse);
2929
req.end();
3030

3131
function onresponse(res) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.