diff --git a/test/parallel/test-fs-readfile-pipe-large.js b/test/parallel/test-fs-readfile-pipe-large.js index b2b5192c789271..78c5feedb7210c 100644 --- a/test/parallel/test-fs-readfile-pipe-large.js +++ b/test/parallel/test-fs-readfile-pipe-large.js @@ -29,7 +29,7 @@ const exec = require('child_process').exec; const f = JSON.stringify(__filename); const node = JSON.stringify(process.execPath); const cmd = `cat ${filename} | ${node} ${f} child`; -exec(cmd, { maxBuffer: 1000000 }, function(err, stdout, stderr) { +exec(cmd, { maxBuffer: 1000000 }, common.mustCall((err, stdout, stderr) => { assert.ifError(err); assert.strictEqual( stdout, @@ -42,7 +42,7 @@ exec(cmd, { maxBuffer: 1000000 }, function(err, stdout, stderr) { `expect that it does not write to stderr, but got : ${stderr}` ); console.log('ok'); -}); +})); process.on('exit', function() { fs.unlinkSync(filename);