From a7e794d1bf4df457020ca608a7dde80174914d58 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 28 Nov 2020 08:31:42 -0800 Subject: [PATCH] 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 --- test/parallel/parallel.status | 2 -- .../test-http2-respond-file-error-pipe-offset.js | 9 ++++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status index 40aabc76265033..9d1898361b7692 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -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 diff --git a/test/parallel/test-http2-respond-file-error-pipe-offset.js b/test/parallel/test-http2-respond-file-error-pipe-offset.js index 21fccb905d7224..39876baaf51dab 100644 --- a/test/parallel/test-http2-respond-file-error-pipe-offset.js +++ b/test/parallel/test-http2-respond-file-error-pipe-offset.js @@ -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); + } +}));