diff --git a/test/parallel/test-stream2-large-read-stall.js b/test/parallel/test-stream2-large-read-stall.js index 36d4e0c6c9d7c9..2422747f820bc1 100644 --- a/test/parallel/test-stream2-large-read-stall.js +++ b/test/parallel/test-stream2-large-read-stall.js @@ -33,7 +33,9 @@ r.on('readable', function() { rs.length); }); -r.on('end', common.mustCall(function() {})); +r.on('end', common.mustCall(function() { + assert.strictEqual(pushes, PUSHCOUNT + 1); +})); let pushes = 0; function push() { @@ -49,7 +51,3 @@ function push() { if (r.push(Buffer.allocUnsafe(PUSHSIZE))) setTimeout(push, 1); } - -process.on('exit', function() { - assert.strictEqual(pushes, PUSHCOUNT + 1); -});