FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Test revisions by DavidGoussev · Pull Request #10551 · nodejs/node · GitHub

/ node Public

Test revisions - #10551

Closed
DavidGoussev wants to merge 4 commits into
nodejs:masterfrom
DavidGoussev:test_revisions
Closed

Test revisions#10551
DavidGoussev wants to merge 4 commits into
nodejs:masterfrom
DavidGoussev:test_revisions

Conversation

Copy link
Copy Markdown
Contributor

test: implement callback wrapper common.mustCall

In test/parallel/test-stream2-readable-wrap.js:

  • replace process.on('exit', ...) block by wrapping all callbacks with common.mustCall
  • replace assert.equal() with assert.strictEqual()
  • add a duration of 1 second to setTimeout() on line 61
  • replace var with const or let

nodejs-github-bot added test Issues and PRs related to the tests. lts-watch-v6.x labels Dec 31, 2016
mscdex added the stream Issues and PRs related to the stream subsystem. label Dec 31, 2016

mscdex commented Dec 31, 2016

Copy link
Copy Markdown
Contributor

First line of commit messages must be <= 50 characters.

var r = new Readable({ highWaterMark: highWaterMark,
const old = new EE();
const r = new Readable({ highWaterMark: highWaterMark,
objectMode: objectMode });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The indentation needs to be adjusted here to re-align with the first 'h'.


var ended = false;
r.on('end', function() {
let ended = false;

mscdex Dec 31, 2016
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This can be removed completely, along with any references since we're already ensuring 'end' is seen via common.mustCall() right below.

var item = produce();
const item = produce();
expected.push(item);
console.log('old.emit', chunks, flowing);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please remove all of these console.* statements.


var w = new Writable({ highWaterMark: highWaterMark * 2,
const w = new Writable({ highWaterMark: highWaterMark * 2,
objectMode: objectMode });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Indentation here needs to be adjusted as well.

console.log('_write', chunk);
written.push(chunk);
setTimeout(cb);
setTimeout(cb, 1000);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This should be 1 instead of 1000.

console.log('_write', chunk);
written.push(chunk);
setTimeout(cb);
setTimeout(cb, 1000);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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); });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

mscdex commented Dec 31, 2016

Copy link
Copy Markdown
Contributor

Trott commented Dec 31, 2016

Copy link
Copy Markdown
Member

Single host failing on CI is an unrelated build infrastructure issue. CI looks good.

Trott commented Dec 31, 2016

Copy link
Copy Markdown
Member

LGTM. Thanks for doing this!

gibfahn commented Dec 31, 2016

Copy link
Copy Markdown
Member

FYI, your name for this commit is set as dpg5000, people normally use their full name. If you want to change it the commands are:

# 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!

Trott pushed a commit to Trott/io.js that referenced this pull request Jan 3, 2017
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>

Trott commented Jan 3, 2017

Copy link
Copy Markdown
Member

Landed in e1fedfb.
Thanks for the contribution! 🎉

Trott closed this Jan 3, 2017

Copy link
Copy Markdown
Contributor

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.

Trott commented Jan 4, 2017
edited
Loading

Copy link
Copy Markdown
Member

@evanlucas curl -L https://github.com/nodejs/node/pull/10551.patch | git am -3 is landing cleanly for me on v7.x-staging.

Trott commented Jan 4, 2017

Copy link
Copy Markdown
Member

@evanlucas (Is the key that a cherry-pick has to land cleanly?)

Trott commented Jan 6, 2017

Copy link
Copy Markdown
Member

@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.

italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 18, 2017
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>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 19, 2017
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>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 26, 2017
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>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 27, 2017
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>
italoacasas mentioned this pull request Jan 29, 2017
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 30, 2017
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>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 30, 2017
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>

Copy link
Copy Markdown
Contributor

would someone be open to backporting this?

DavidGoussev commented Mar 8, 2017 via email

Copy link
Copy Markdown
Contributor Author

gibfahn commented Mar 8, 2017

Copy link
Copy Markdown
Member

@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.

Copy link
Copy Markdown
Contributor Author

@gibfahn Hi Gibson, thanks! Running into a slight issue with git checkout v7.x-staging

I receive error: pathspec 'v7.x-staging' did not match any file(s) known to git.

To confirm, my origin remote points to my node fork, and my upstream remote points to https://github.com/nodejs/node.git

Copy link
Copy Markdown
Member

@dpg5000 Does it work when you run git branch v7.x-staging origin/v7.x-staging first?

gibfahn commented Mar 9, 2017

Copy link
Copy Markdown
Member

@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 git branch v7.x-staging upstream/v7.x-staging

Copy link
Copy Markdown
Contributor Author

@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)?

gibfahn commented Mar 11, 2017

Copy link
Copy Markdown
Member

@dpg5000 the other release lines are v6.x and v4.x. Node v4 is about to go into maintenance, so I don't think it's worth trying to backport to it. Backporting to v6 would be good though.

MylesBorins pushed a commit that referenced this pull request Apr 15, 2017
Use common.mustCall() where appropriate, var to const/let,
assert.equal() -> assert.strictEqual(), explicit time provided to
setTimeout()

Backport-PR-URL: #11797
PR-URL: #10551
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
MylesBorins pushed a commit that referenced this pull request Apr 19, 2017
Use common.mustCall() where appropriate, var to const/let,
assert.equal() -> assert.strictEqual(), explicit time provided to
setTimeout()

Backport-PR-URL: #11797
PR-URL: #10551
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
MylesBorins mentioned this pull request Apr 19, 2017
andrew749 pushed a commit to michielbaird/node that referenced this pull request Jul 19, 2017
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stream Issues and PRs related to the stream subsystem. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants


Back | FazBrowse Home | New Git URL