-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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 revisions #10551
Test revisions #10551
Conversation
First line of commit messages must be <= 50 characters. |
var old = new EE(); | ||
var r = new Readable({ highWaterMark: highWaterMark, | ||
const old = new EE(); | ||
const r = new Readable({ highWaterMark: highWaterMark, | ||
objectMode: objectMode }); |
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 indentation needs to be adjusted here to re-align with the first 'h'.
|
||
var ended = false; | ||
r.on('end', function() { | ||
let ended = false; |
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.
This can be removed completely, along with any references since we're already ensuring 'end' is seen via common.mustCall()
right below.
function flow() { | ||
flowing = true; | ||
while (flowing && chunks-- > 0) { | ||
var item = produce(); | ||
const item = produce(); | ||
expected.push(item); | ||
console.log('old.emit', chunks, flowing); |
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.
Please remove all of these console.*
statements.
@@ -52,19 +49,18 @@ function runTest(highWaterMark, objectMode, produce) { | |||
} | |||
} | |||
|
|||
var w = new Writable({ highWaterMark: highWaterMark * 2, | |||
const w = new Writable({ highWaterMark: highWaterMark * 2, | |||
objectMode: objectMode }); |
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.
Indentation here needs to be adjusted as well.
w._write = function(chunk, encoding, cb) { | ||
console.log('_write', chunk); | ||
written.push(chunk); | ||
setTimeout(cb); | ||
setTimeout(cb, 1000); |
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.
This should be 1
instead of 1000
.
w._write = function(chunk, encoding, cb) { | ||
console.log('_write', chunk); | ||
written.push(chunk); | ||
setTimeout(cb); | ||
setTimeout(cb, 1000); |
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 change this to 1
instead of 1000
? No duration specified defaults to 1ms, so using 1
keeps the behavior identical but makes things more explicit.
runTest(100, false, function() { return Buffer.allocUnsafe(100); }); | ||
runTest(10, false, function() { return Buffer.from('xxxxxxxxxx'); }); | ||
runTest(1, true, function() { return { foo: 'bar' }; }); | ||
runTest(100, false, common.mustCall(function() { return Buffer.allocUnsafe(100); }); |
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.
There's a missing )
at the end of this line. This is a syntax error. This file won't run. (It looks the pull request template was deleted. It asks that make -j4 test
before submitting the pull request.)
@@ -1,24 +1,21 @@ | |||
'use strict'; | |||
require('../common'); |
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.
common
is undefined because this line has not been changed to const common = require('../common');
So again, there's no way this test can actually run as is.
Single host failing on CI is an unrelated build infrastructure issue. CI looks good. |
LGTM. Thanks for doing this! |
FYI, your name for this commit is set as # To change it everywhere:
git config --global user.name "David Goussev"
# To change it for a single commit:
git commit --amend --no-edit --author="David Goussev <dgoussev@gmail.com>" Whoever lands this Pull Request can do it for you as part of the landing process instead if you'd like. If you don't want to change it that's totally fine too! |
Use common.mustCall() where appropriate, var to const/let, assert.equal() -> assert.strictEqual(), explicit time provided to setTimeout() PR-URL: nodejs#10551 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Landed in e1fedfb. |
This is not landing cleanly on v7.x-staging. If you would like to see it there, a backport pull request would need to be opened. |
@evanlucas |
@evanlucas (Is the key that a cherry-pick has to land cleanly?) |
@evanlucas You can use this, then? Or would you prefer @dpg5000 create a second PR with these changes against the v7.x-staging branch? I suppose another possibility is don't worry about it at all and just let these changes stick around in master and only hit a release branch come v8.0.0 in April. These changes don't affect users. |
Use common.mustCall() where appropriate, var to const/let, assert.equal() -> assert.strictEqual(), explicit time provided to setTimeout() PR-URL: nodejs#10551 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Use common.mustCall() where appropriate, var to const/let, assert.equal() -> assert.strictEqual(), explicit time provided to setTimeout() PR-URL: nodejs#10551 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Use common.mustCall() where appropriate, var to const/let, assert.equal() -> assert.strictEqual(), explicit time provided to setTimeout() PR-URL: nodejs#10551 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Use common.mustCall() where appropriate, var to const/let, assert.equal() -> assert.strictEqual(), explicit time provided to setTimeout() PR-URL: nodejs#10551 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Use common.mustCall() where appropriate, var to const/let, assert.equal() -> assert.strictEqual(), explicit time provided to setTimeout() PR-URL: nodejs#10551 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Use common.mustCall() where appropriate, var to const/let, assert.equal() -> assert.strictEqual(), explicit time provided to setTimeout() PR-URL: nodejs#10551 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
would someone be open to backporting this? |
Would love to help, this was my PR. What's involved with backporting?
David
…On Mar 8, 2017 1:54 AM, "Myles Borins" ***@***.***> wrote:
would someone be open to backporting this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10551 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AMpemJJ7NJ-t6w_iOA3nkflrK-_ACwSQks5rjnrDgaJpZM4LYfMh>
.
|
@dpg5000 There's a howto in #11099. It's still under review, but the process for submitting the backport PR should be okay to follow. |
@gibfahn Hi Gibson, thanks! Running into a slight issue with I receive To confirm, my origin remote points to my node fork, and my upstream remote points to https://github.com/nodejs/node.git |
@dpg5000 Does it work when you run |
@dpg5000 yep, see discussion in that PR from #11099 (comment) onwards. You want to do what @bnoordhuis suggests, although I'm pretty sure it should be |
@gibfahn Hi Gibson, apparently this PR has been backported to v7.x already (successfully). Is there a previous version that it still needs to be backported to (as @MylesBorins mentioned earlier above)? |
@dpg5000 the other release lines are |
Use common.mustCall() where appropriate, var to const/let, assert.equal() -> assert.strictEqual(), explicit time provided to setTimeout() Backport-PR-URL: nodejs/node#11797 PR-URL: nodejs/node#10551 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
test: implement callback wrapper
common.mustCall
In
test/parallel/test-stream2-readable-wrap.js
:process.on('exit', ...)
block by wrapping all callbacks withcommon.mustCall
assert.equal()
withassert.strictEqual()
setTimeout()
on line 61var
withconst
orlet