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 authored and Michaël Zasso committed 2021-04-25 07:17:12 +02:00
1 parent c1af59384d
commit cd1da67295
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);
}
}));