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: rearrange inspector headers into convention #13428

Merged
merged 1 commit into from
Jun 5, 2017

Conversation

sam-github
Copy link
Contributor

Test guide describes a conventional layout for test headers, review
inspector tests and reorganize to follow the convention.

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

test,inspector

@nodejs-github-bot nodejs-github-bot added dont-land-on-v4.x inspector Issues and PRs related to the V8 inspector protocol test Issues and PRs related to the tests. labels Jun 3, 2017
@sam-github
Copy link
Contributor Author

@cjihrig noticed I wasn't following convention in #13228, because I'd copied test/parallel/test-inspector-invalid-args.js, so I reviewed the inspector tests. Most are OK, except for white space, but I fixed up the one that isn't using the new order convention.

@@ -17,14 +18,14 @@ if (cluster.isMaster) {
}));
worker.send('debugPort');
}
process.on('exit', () => {
process.on('exit', common.mustCall(() => {
Copy link
Member

Choose a reason for hiding this comment

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

IIUC, common.mustCall() on an exit handler won't do anything because the check for execution in mustCall() is itself dependent on the exit event. Any situation that would skip calling the function will also skip the check that the function has been called. If the event does not fire, then the check never happens. Unless I'm mistaken about all this, I'd say common.mustCall() should be removed because it provides a false guarantee that the function will be called.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is true iff event handlers are called in the order they were registered. So the the one checking all the mustCalls would run before this one, and IIUC it would fail since this instance didn't run yet.

Anyway test-inspector-port-zero-cluster.js is a PITA, re: #13373

Copy link
Contributor

Choose a reason for hiding this comment

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

Ohh @sam-github we need you input in #13373

Copy link
Contributor

@refack refack left a comment

Choose a reason for hiding this comment

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

LGTM % the mustCall thing

Trott
Trott previously requested changes Jun 3, 2017
Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

Needs one common.mustCall() removed.

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

No real opinion on the whitespace changes. The process.on('exit', common.mustCall()) change should be backed out I think. +1 to the changes in test/parallel/test-inspector-invalid-args.js

@refack
Copy link
Contributor

refack commented Jun 3, 2017

CI: https://ci.nodejs.org/job/node-test-commit/10341/
(wanted to find out if my assumption was correct)

@refack
Copy link
Contributor

refack commented Jun 3, 2017

Mismatched <anonymous> function calls. Expected exactly 1, actual 0.
    at Object.exports.mustCall (/data/iojs/build/workspace/node-test-commit-linuxone/nodes/rhel72-s390x/test/common/index.js:483:10)
    at Object.<anonymous> (/data/iojs/build/workspace/node-test-commit-linuxone/nodes/rhel72-s390x/test/inspector/test-inspector-port-zero-cluster.js:21:29)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
Debugger listening on ws://127.0.0.1:38692/dc906197-d686-4160-9dba-56213523da01
For help see https://nodejs.org/en/docs/inspector
Debugger listening on ws://127.0.0.1:38693/1e3ceb9e-7e0e-4221-8b53-a72fc3c7f434
For help see https://nodejs.org/en/docs/inspector
Debugger listening on ws://127.0.0.1:38694/0daabd15-183e-4f46-bd24-7076eaefdd9f
For help see https://nodejs.org/en/docs/inspector
Debugger listening on ws://127.0.0.1:38695/8d609731-d5a7-4859-b665-7138b64d88df
For help see https://nodejs.org/en/docs/inspector

@sam-github
Copy link
Contributor Author

sam-github commented Jun 5, 2017

ci: https://ci.nodejs.org/job/node-test-pull-request/8485/

@Trott removed the common.mustCall, PTAL: da1602e

@Trott Trott dismissed their stale review June 5, 2017 18:34

mustCall() removed, clearing my request for changes

@Trott
Copy link
Member

Trott commented Jun 5, 2017

This is now a whitespace-only change.

Do we truly want to enforce blank lines after common is loaded and all that stuff?

If so, we should add a lint rule (in a separate PR--not asking for a change to this one).

If not, we probably don't need to land this.

@@ -1,11 +1,12 @@
'use strict';
const common = require('../common');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Trott this is not whitespace only. I can remove all the other whitespace only changes if you'd like, I think they are more readable, and I think they are implied by the test guide, but this change, specifically, brings this test into conformance with the guide.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, yes, missed that one, sorry. Anyway, yeah, it's all fine. No objections.

Test guide describes a conventional layout for test headers, review
inspector tests and reorganize to follow the convention.

PR-URL: nodejs#13428
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@sam-github sam-github merged commit aae0d45 into nodejs:master Jun 5, 2017
jasnell pushed a commit that referenced this pull request Jun 5, 2017
Test guide describes a conventional layout for test headers, review
inspector tests and reorganize to follow the convention.

PR-URL: #13428
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@jasnell jasnell mentioned this pull request Jun 5, 2017
@sam-github sam-github deleted the inspector-test-cleanup branch June 14, 2017 20:33
@gibfahn gibfahn mentioned this pull request Jun 15, 2017
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inspector Issues and PRs related to the V8 inspector protocol test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants