Skip to content

Commit

Permalink
test: log errors in test-fs-readfile-tostring-fail
Browse files Browse the repository at this point in the history
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: #27058
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
richardlau committed Apr 16, 2019
1 parent 53e0f63 commit f85ef97
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/pummel/test-fs-readfile-tostring-fail.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit f85ef97

Please sign in to comment.