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 b190b0e

Browse filesBrowse files
lpincatargos
authored andcommitted
test: deflake http2-pipe-named-pipe
Wait for all data to be read before sending the response and closing the client. Fixes: #40277 PR-URL: #40842 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Adrian Estrada <edsadr@gmail.com>
1 parent c485460 commit b190b0e
Copy full SHA for b190b0e

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎test/parallel/test-http2-pipe-named-pipe.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-pipe-named-pipe.js
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ const server = http2.createServer();
2222
server.on('stream', common.mustCall((stream) => {
2323
const dest = stream.pipe(fs.createWriteStream(fn));
2424

25-
dest.on('finish', () => {
25+
stream.on('end', common.mustCall(() => {
26+
stream.respond();
27+
stream.end();
28+
}));
29+
30+
dest.on('finish', common.mustCall(() => {
2631
assert.strictEqual(fs.readFileSync(loc).length,
2732
fs.readFileSync(fn).length);
28-
});
29-
stream.respond();
30-
stream.end();
33+
}));
3134
}));
3235

3336
server.listen(common.PIPE, common.mustCall(() => {

0 commit comments

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