-
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: fix parallel/test-debug-signal-cluster #501
Conversation
@@ -4,22 +4,21 @@ var spawn = require('child_process').spawn; | |||
|
|||
var debugPort = common.PORT; | |||
var args = ['--debug-port=' + debugPort]; |
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.
shouldn't this be in sequential if it's doing a listen?
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.
No, there are plenty of parallel tests that listen on a port. The logic for that is in tools/test.py and test/common.js: the former sets TEST_THREAD_ID which the latter turns into a per-thread port range.
Aside: 'thread' is a bit of a misnomer because they are really separate processes.
I'm not really grokking the changes in test-debug-signal-cluster.js with a quick scan but it's passing CI so 👍 |
lgtm |
Make this test less prone to race conditions by using synchronous interprocess communication instead of a timer to determine when the child process is ready to receive messages from its parent. Also, remove a superfluous timer since the tests suite already makes tests time out after a while. Original-PR-URL: nodejs/node-v0.x-archive#9049 Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com> PR-URL: nodejs#501 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Bert Belder <bertbelder@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
Move sequential/test-debug-port-from-cmdline to test/parallel. Per the previous commit, it should now be possible to run the test in parallel with other debugger tests. PR-URL: nodejs#501 Reviewed-By: Bert Belder <bertbelder@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
Temporarily revert the changes to test/ from commit 11c1bae ("lib: make --debug-port work with cluster") to ease cherry-picks from joyent/node. PR-URL: nodejs#501 Reviewed-By: Bert Belder <bertbelder@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
unref one superfluous timer (as the test suite already has a global timeout), and improve the state machine to iterate the messages more reliably. Ultimately make the test complete more quickly. Original-PR-URL: [unknown] Signed-off-by: Julien Gilli <julien.gilli@joyent.com> PR-URL: nodejs#501 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Bert Belder <bertbelder@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
Reland the changes from commit 11c1bae ("lib: make --debug-port work with cluster") that were temporarily backed out to cherry-pick commits from joyent/node. PR-URL: nodejs#501 Reviewed-By: Bert Belder <bertbelder@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
Previously if a worker's state machine had already transitioned into the 'listening' state when it received the message enabling the debugger, the worker would never enable its debugger. Change the logic to allow the 'listening' as a valid state for enabling the debugger. Fixes: nodejs/node-v0.x-archive#6440 Original-PR-URL: nodejs/node-v0.x-archive#9037 Signed-off-by: Julien Gilli <julien.gilli@joyent.com> Fixes: nodejs#340 PR-URL: nodejs#501 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Bert Belder <bertbelder@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
1d3d3ca
to
4dd22b9
Compare
Fixes: #340
R=@piscisaureus and @rvagg
I cherry-picked some of the commits from joyent/node@v0.12. The commit logs don't mention the original SHA but I did try to link to the relevant PR where possible. Suggestions for improvement welcome.
https://jenkins-iojs.nodesource.com/view/iojs/job/iojs+any-pr+multi/93/