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

lib: make --debug-port work with cluster #306

Merged
merged 4 commits into from
Jan 12, 2015

Conversation

bnoordhuis
Copy link
Member

Note that parallel/test-debug-port-cluster still fails every now and but at least it fails faster now. It's not a regression.

R=@bajtos?

var port = common.PORT + 42;
var args = ['--debug-port=' + port,
common.fixturesDir + '/clustered-server/app.js'];
var options = {stdio: ['inherit', 'inherit', 'pipe', 'ipc']};
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, what is the reasoning behind this change?

- stdio: [ 'pipe', 'pipe', 'pipe', 'ipc' ]
+ stdio: ['inherit', 'inherit', 'pipe', 'ipc']

Also IIRC the convention is to put a space after an opening curly brace and before a closing curling brace.

{ stdio: ['inherit', 'inherit', 'pipe', 'ipc'] }

Copy link
Member Author

Choose a reason for hiding this comment

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

'inherit' makes console.log() statements visible. Before, stdout output was silently dropped. Makes it harder to debug.

Copy link
Member Author

Choose a reason for hiding this comment

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

Apropos the style, a quick grep through the test suite finds more occurrences of [a, b, c] than of [ a, b, c ].

Copy link
Contributor

Choose a reason for hiding this comment

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

'inherit' makes console.log() statements visible. Before, stdout output was silently dropped. Makes it harder to debug.

Makes sense, that's a change towards better.

Apropos the style, a quick grep through the test suite finds more occurrences of [a, b, c] than of [ a, b, c ].

Yes, that's correct. I was pointing out that IIRC { a: 1 } is more common than {a: 1}.

@bnoordhuis
Copy link
Member Author

@bajtos Any further comments or LGTY?

@bajtos
Copy link
Contributor

bajtos commented Jan 12, 2015

@bnoordhuis One more comment regarding the coding style, fee free to ignore it.

LGTM.

The test does not work well with concurrent invocations of the test
runner because it uses fixed port numbers.  The functionality it tests
is covered by sequential/test-debug-port-cluster, a verbatim copy with
the only difference being that it doesn't use fixed port numbers.

PR-URL: nodejs#306
Reviewed-By: Miroslav Bajtoš <[email protected]>
Make the cluster module intercept the `--debug-port=<port>` command line
switch and replace it with the debug port of the child process.

A happy coincidence of this change is that it finally makes it possible
to run the sequential/test-debug-signal-cluster in parallel, it now no
longer needs the default port numbers.

PR-URL: nodejs#306
Reviewed-By: Miroslav Bajtoš <[email protected]>
Move sequential/test-debug-signal-cluster to test/parallel.  Per the
previous commit, it can now run in parallel with other debugger tests.

PR-URL: nodejs#306
Reviewed-By: Miroslav Bajtoš <[email protected]>
Move sequential/test-debug-port-cluster to test/parallel.  This test
is safe to run in parallel with other debugger tests, it doesn't use
fixed port numbers.

PR-URL: nodejs#306
Reviewed-By: Miroslav Bajtoš <[email protected]>
@bnoordhuis bnoordhuis merged commit c8676cb into nodejs:v1.x Jan 12, 2015
@bnoordhuis bnoordhuis deleted the fix-cluster-debug-port branch January 12, 2015 17:51
@bnoordhuis
Copy link
Member Author

Thanks, Miroslav. Sorry, you're right - I misread your style comment. Feedback incorporated and landed in c8676cb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants