test: fix flaky test-http2-respond-file-error-pipe-offset

Fixes: https://github.com/nodejs/node/issues/35881

PR-URL: https://github.com/nodejs/node/pull/36305
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Rich Trott committed 2020-12-07 07:29:30 -08:00
1 parent 537da195dd
commit f178c5a134
2 files changed
+8 -3

No files matched your search

-2
View File
@@ -5,8 +5,6 @@ prefix parallel
# sample-test : PASS,FLAKY
[true] # This section applies to all platforms
# https://github.com/nodejs/node/issues/35881
test-http2-respond-file-error-pipe-offset: PASS,FLAKY
[$system==win32]
# https://github.com/nodejs/node/issues/20750
@@ -56,4 +56,11 @@ server.listen(0, () => {
req.end();
});
fs.writeFile(pipeName, 'Hello, world!\n', common.mustSucceed());
fs.writeFile(pipeName, 'Hello, world!\n', common.mustCall((err) => {
// It's possible for the reading end of the pipe to get the expected error
// and break everything down before we're finished, so allow `EPIPE` but
// no other errors.
if (err?.code !== 'EPIPE') {
assert.ifError(err);
}
}));