Skip to content
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: add and assert readable/writable arguments #8815

Closed
wants to merge 3 commits into from

Conversation

danbev
Copy link
Contributor

@danbev danbev commented Sep 28, 2016

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test

Description of change

Currently the readable and writable arguments are not specified in the
req.oncomplete method. Adding and asserting that they are always true
(which is always the case for TCP). This might seem unnecessary but it
can't hurt to have them to pickup any breaking modifications made to
ConnectionWrap::AfterConnect in the future.

Currently the readable and writable arguments are not specified in the
req.oncomplete method. Adding and asserting that they are always true
(which is always the case for TCP). This might seem unnecessary but it
can't hurt to have them to pickup any breaking modifications made to
ConnectionWrap::AfterConnect in the future.
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Sep 28, 2016
@danbev
Copy link
Contributor Author

danbev commented Sep 28, 2016

@mscdex mscdex added the net Issues and PRs related to the net subsystem. label Sep 28, 2016
assert.equal(0, status);
assert.equal(client, client_);
assert.equal(req, req_);
assert.equal(true, readable);
Copy link
Contributor

Choose a reason for hiding this comment

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

We have been moving toward using assert.strictEqual() instead of assert.equal().

@danbev
Copy link
Contributor Author

danbev commented Sep 28, 2016

We have been moving toward using assert.strictEqual() instead of assert.equal().

Thanks, I'll fix that.

assert.equal(0, status);
assert.equal(client, client_);
assert.equal(req, req_);
assert.equal(true, readable);
assert.equal(true, writable);

console.log('connected');
Copy link
Member

Choose a reason for hiding this comment

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

nit: while you're in here, would you mind removing the unnecessary console.log() statements ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nit: while you're in here, would you mind removing the unnecessary console.log() statements ?

Sure, no problems I'll remove them.

@italoacasas
Copy link
Contributor

italoacasas commented Sep 28, 2016

I'm not 100% sure but I think this callback should use common.mustCall()

https://github.com/danbev/node/blob/6d74b010b6212b6b78b82abcd6acb21c1dcb9fcf/test/parallel/test-tcp-wrap-connect.js#L58

@cjihrig
Copy link
Contributor

cjihrig commented Sep 28, 2016

We don't put process.on('exit', ...) in common.mustCall().

Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

LGTM with a green-ish CI run

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

LGTM

@jasnell
Copy link
Member

jasnell commented Sep 30, 2016

danbev added a commit to danbev/node that referenced this pull request Oct 2, 2016
Currently the readable and writable arguments are not specified in the
req.oncomplete method. Adding and asserting that they are always true
(which is always the case for TCP). This might seem unnecessary but it
can't hurt to have them to pickup any breaking modifications made to
ConnectionWrap::AfterConnect in the future.

PR-URL: nodejs#8815
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
@danbev
Copy link
Contributor Author

danbev commented Oct 2, 2016

Landed in: 3c5cf12

@danbev danbev closed this Oct 2, 2016
@danbev danbev deleted the add-readable-writable-parameters branch October 2, 2016 05:14
jasnell pushed a commit that referenced this pull request Oct 6, 2016
Currently the readable and writable arguments are not specified in the
req.oncomplete method. Adding and asserting that they are always true
(which is always the case for TCP). This might seem unnecessary but it
can't hurt to have them to pickup any breaking modifications made to
ConnectionWrap::AfterConnect in the future.

PR-URL: #8815
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Fishrock123 pushed a commit that referenced this pull request Oct 11, 2016
Currently the readable and writable arguments are not specified in the
req.oncomplete method. Adding and asserting that they are always true
(which is always the case for TCP). This might seem unnecessary but it
can't hurt to have them to pickup any breaking modifications made to
ConnectionWrap::AfterConnect in the future.

PR-URL: #8815
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
net Issues and PRs related to the net subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants