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 1e3aed0

Browse filesBrowse files
addaleaxMylesBorins
authored andcommitted
test: fix flaky parallel/test-http2-client-upload
In parallel/test-http2-client-upload, the `client.destroy()` call could terminate the connection before all data was sent over the wire successfully. Using `client.shutdown()` removes the flakiness. Also, listen on `req.on('finish')` rather than the file stream’s `end` event, since we’re not interested in when the source stream finishes, but rather when the HTTP/2 stream finishes. PR-URL: #17361 Refs: #17356 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Kyle Farnung <kfarnung@microsoft.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Jon Moss <me@jonathanmoss.me>
1 parent 7ae7124 commit 1e3aed0
Copy full SHA for 1e3aed0

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎test/parallel/test-http2-client-upload.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-client-upload.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fs.readFile(loc, common.mustCall((err, data) => {
3838
function maybeClose() {
3939
if (--remaining === 0) {
4040
server.close();
41-
client.destroy();
41+
client.shutdown();
4242
}
4343
}
4444

@@ -47,7 +47,7 @@ fs.readFile(loc, common.mustCall((err, data) => {
4747
req.resume();
4848
req.on('end', common.mustCall(maybeClose));
4949
const str = fs.createReadStream(loc);
50-
str.on('end', common.mustCall(maybeClose));
50+
req.on('finish', common.mustCall(maybeClose));
5151
str.pipe(req);
5252
}));
5353
}));

0 commit comments

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