-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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: stream readable resumeScheduled state #10299
test: stream readable resumeScheduled state #10299
Conversation
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 up to the linter errors CI is showing
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.
Can you please add checks also for on('data')
and pipe()
? Both of those trigger a resume()
.
// pipe() test case | ||
const r = new Readable({ read() {} }); | ||
// event 'data' test case | ||
const r2 = new Readable({ read() {} }); |
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.
Can you separate these using block scopes, as done in a lot of other tests. Then, you can reuse the same variable names.
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.
ok
const { Readable, Writable } = require('stream'); | ||
|
||
{ | ||
// First test, expect the correct behavior |
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 would drop the "First test," "Second test," etc. from the comments. They will likely become out of date as people change the file.
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
Landed 6137983 |
PR-URL: nodejs#10299 Ref: nodejs#8683 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test
Description of change
Adding test for the
resumeScheduled
state in stream.ReadableRef: #8683
CI: https://ci.nodejs.org/job/node-test-pull-request/5446/console
cc: @mcollina