From f85ef977e6e9f0f655a8ff6aa4796d80ae94010e Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Tue, 2 Apr 2019 08:04:16 -0400 Subject: [PATCH] test: log errors in test-fs-readfile-tostring-fail The test writes out a large file via `fs.createWriteStream()` but was not listening for the `error` event, which the `fs` docs describe as the reliable way to detect write errors. PR-URL: https://github.com/nodejs/node/pull/27058 Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig --- test/pummel/test-fs-readfile-tostring-fail.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/pummel/test-fs-readfile-tostring-fail.js b/test/pummel/test-fs-readfile-tostring-fail.js index 9a443fc71bb2c3..a068b3af3b0cea 100644 --- a/test/pummel/test-fs-readfile-tostring-fail.js +++ b/test/pummel/test-fs-readfile-tostring-fail.js @@ -21,6 +21,8 @@ const stream = fs.createWriteStream(file, { flags: 'a' }); +stream.on('error', (err) => { throw err; }); + const size = kStringMaxLength / 200; const a = Buffer.alloc(size, 'a');