Skip to content

Commit a87605f

Browse files
committed
stream: change comment
1 parent 2434906 commit a87605f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/parallel/test-stream-readable-to-web.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ const process = require('process');
55
const fs = require('fs');
66
const assert = require('assert');
77

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

1112
// We initialize a stream, but not start consuming it
1213
const randomNodeStream = fs.createReadStream('/dev/urandom');
13-
// after 10 seconds, it'll get converted to web stream
14+
// after 2 seconds, it'll get converted to web stream
1415
let randomWebStream;
1516

1617
// We check memory usage every second
@@ -23,13 +24,13 @@ const assert = require('assert');
2324
};
2425
setInterval(reportMemoryUsage, 1000);
2526

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

32-
// after 15 seconds we start consuming the stream
33+
// after 2 seconds we start consuming the stream
3334
// memory usage will grow, but the old chunks should be garbage-collected pretty quickly
3435
setTimeout(async () => {
3536
// eslint-disable-next-line no-unused-vars
@@ -39,6 +40,7 @@ const assert = require('assert');
3940
}, 2000);
4041

4142
setTimeout(() => {
43+
// Test considered passed if we don't crash
4244
process.exit(0);
4345
}, 5000);
4446
}

0 commit comments

Comments
 (0)