Skip to content

Commit 41330d8

Browse files
committed
fixup! stream: readable read one buffer at a time
1 parent 01a9ec9 commit 41330d8

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

test/parallel/test-stream-readable-needReadable.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,9 @@ const asyncReadable = new Readable({
3232
});
3333

3434
asyncReadable.on('readable', common.mustCall(() => {
35-
if (asyncReadable.read() !== null) {
36-
// After each read(), the buffer is empty.
37-
// If the stream doesn't end now,
38-
// then we need to notify the reader on future changes.
39-
assert.strictEqual(asyncReadable._readableState.needReadable, true);
35+
while (asyncReadable.read() !== null) {
4036
}
37+
assert.strictEqual(asyncReadable._readableState.needReadable || asyncReadable._readableState.ended, true);
4138
}, 2));
4239

4340
process.nextTick(common.mustCall(() => {

test/parallel/test-webstreams-pipeline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ const http = require('http');
181181
});
182182

183183
pipeline(rs, t, ws, common.mustSucceed(() => {
184-
assert.deepStrictEqual(values, ['HELLOWORLD']);
184+
assert.deepStrictEqual(values, ['HELLO', 'WORLD']);
185185
}));
186186

187187
c.enqueue('hello');

0 commit comments

Comments
 (0)