-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: tests for _readableStream.awaitDrain #8914
Conversation
reader.push(buffer); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary whitespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
cb(); | ||
}, 3) | ||
}); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary whitespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed. maybe it's better to add lint rule and not to check this each time?
|
||
// This is very similar to test-stream-pipe-cleanup-pause.js. | ||
|
||
const reader = new stream.Readable(); | ||
const writer1 = new stream.Writable(); | ||
const writer2 = new stream.Writable(); | ||
const writer3 = new stream.Writable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should add a new writer here. Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it's better to trace if the counter is not stuck on value 1 if we have multiple writers in pipeline. For example, if someone will breake the behavior of this counter and it will work as a flag, he will get error in this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thanks.
writer3._write = common.mustCall(function(chunk, encoding, cb) { | ||
assert.strictEqual( | ||
reader._readableState.awaitDrain, 2, | ||
'writer2 should make awaitDrain = 1 after first buffer push' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe there are typos here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep 😊 , fixed now
@mcollina yep, I'll do that. I made a comment in issue. |
c133999
to
83c7a88
Compare
@shmuga any update on this? |
@shmuga do you still plan to move this forward, or might someone else take over? |
@mcollina can we merge this as is, and open another issue with the other test? |
@italoacasas, go ahead. LGTM |
Sorry guys, just found that I have no notifications for github on email. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic is good. Can you shorten up the assertion messages? we tend to put them in the present tense, without 'should'.
@mcollina hope I haven't missed anything now 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if CI is green
Failures are unrelated, merging. |
Landed as 21a077a. |
Fixes: nodejs#8684 PR-URL: nodejs#8914 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Fixes: nodejs#8684 PR-URL: nodejs#8914 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Fixes: nodejs#8684 PR-URL: nodejs#8914 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Fixes: nodejs#8684 PR-URL: nodejs#8914 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test
Description of change