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 49981b9

Browse filesBrowse files
debadree25RafaelGSS
authored andcommitted
test: reduce flakiness of test-http-remove-header-stays-removed.js
Refs: nodejs/reliability#508 Refs: #46333 PR-URL: #46855 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 8f9b9c1 commit 49981b9
Copy full SHA for 49981b9

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+9
-1
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-http-remove-header-stays-removed.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-remove-header-stays-removed.js
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

2222
'use strict';
23-
require('../common');
23+
const common = require('../common');
2424
const assert = require('assert');
2525

2626
const http = require('http');
@@ -56,6 +56,14 @@ server.listen(0, function() {
5656
res.setEncoding('ascii');
5757
res.on('data', function(chunk) {
5858
response += chunk;
59+
if (response === 'beep boop\n') {
60+
setTimeout(function() {
61+
// The socket should be closed immediately, with no keep-alive, because
62+
// no content-length or transfer-encoding are used:
63+
assert.strictEqual(res.socket.closed, true);
64+
server.close();
65+
}, common.platformTimeout(15));
66+
}
5967
});
6068
});
6169
});

0 commit comments

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