Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: deflake test-http-many-ended-pipelines #38018

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions test/parallel/test-http-many-ended-pipelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

'use strict';
const common = require('../common');
const assert = require('assert');
const http = require('http');
const net = require('net');

Expand All @@ -43,6 +44,14 @@ const server = http.createServer(function(req, res) {
server.listen(0, function() {
const client = net.connect({ port: this.address().port,
allowHalfOpen: true });

client.on('error', function(err) {
// The socket might be destroyed by the other peer while data is still
// being written. The `'EPIPE'` and `'ECONNABORTED'` codes might also be
// valid but they have not been seen yet.
assert.strictEqual(err.code, 'ECONNRESET');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think err.code can also be 'EPIPE' or 'ECONNABORTED' but I was not able to reproduce. Should we handle that in advance or do it if/when it will occur?

Copy link
Member

@Trott Trott Apr 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say let's do it when it occurs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you can add a comment right now that says "EPIPE might be valid too but we haven't seen it yet" or something like that?

});

for (let i = 0; i < numRequests; i++) {
client.write('GET / HTTP/1.1\r\n' +
'Host: some.host.name\r\n' +
Expand Down