Skip to content

Commit

Permalink
stream: change comment
Browse files Browse the repository at this point in the history
  • Loading branch information
CGQAQ committed Jul 20, 2023
1 parent 2434906 commit 2d2b9d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/parallel/test-stream-readable-to-web.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const process = require('process');
const fs = require('fs');
const assert = require('assert');

// Based on: https://github.com/nodejs/node/issues/46347#issuecomment-1413886707
{
let currentMemoryUsage = process.memoryUsage().arrayBuffers;

Expand All @@ -23,13 +24,13 @@ const assert = require('assert');
};
setInterval(reportMemoryUsage, 1000);

// after 10 seconds we use Readable.toWeb
// after 1 second we use Readable.toWeb
// memory usage should stay pretty much the same since it's still a stream
setTimeout(() => {
randomWebStream = Readable.toWeb(randomNodeStream);
}, 1000);

// after 15 seconds we start consuming the stream
// after 2 seconds we start consuming the stream
// memory usage will grow, but the old chunks should be garbage-collected pretty quickly
setTimeout(async () => {
// eslint-disable-next-line no-unused-vars
Expand Down

0 comments on commit 2d2b9d0

Please sign in to comment.