-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
inspector: introduce a smoke test for inspector #8429
Conversation
Assuming the test is expected to work on Windows, I imagine there should probably be a |
|
@nodejs/testing |
It would be good to have the added, provided it passes across the platforms |
Nit: add an entry for the (We didn't do that for |
@@ -33,7 +33,7 @@ static void dump_hex(const char* buf, size_t len) { | |||
while (ptr < end) { | |||
cptr = ptr; | |||
for (i = 0; i < 16 && ptr < end; i++) { | |||
printf("%2.2X ", *(ptr++)); | |||
printf("%2.2X ", (unsigned char) *(ptr++)); |
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.
Avoid C style casts.
Adressed the comments:
|
@@ -0,0 +1,167 @@ | |||
'use strict'; | |||
const assert = require('assert'); | |||
require('../common'); |
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.
I think ../common
should be the first require
Looks like this is coming up from time to time on Linux variants:
|
var k = 1; | ||
console.log('A message', 5); | ||
while (t > 0) { | ||
if (t++ == 1000) { |
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.
s/==/===
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.
This nit still needs to be addressed.
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.
Thanks for pointing out - I haven't noticed that comment. Fixed.
Thanks for all the comments. Updated the CL:
|
[ '--inspect', '--debug-brk', mainScript ]); | ||
|
||
const timeoutId = setTimeout(() => { | ||
assert(false, 'Child process did not start properly'); |
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.
maybe use common.fail
here
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.
Done
@@ -620,6 +622,7 @@ bool AgentImpl::OnInspectorHandshakeIO(inspector_socket_t* socket, | |||
return false; | |||
default: | |||
UNREACHABLE(); | |||
return false; |
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.
Unrelated change. Is it to squelch a compiler warning?
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.
Seems to be a VC++ warning. I fixed it as I was testing on Windows.
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.
LGTM w/ nits.
callback); | ||
} | ||
|
||
function processIncomingMessage(socket, buffer, handler) { |
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.
socket
is unused?
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.
Thanks. Fixed.
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.
Did you fix this? Either the new github review mechanism is lying to me, or socket is still a parameter here.
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.
Not sure what I did wrong - but I reuploaded the fix.
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.
Thank you for the review. I addressed the comments and uploaded a new version.
callback); | ||
} | ||
|
||
function processIncomingMessage(socket, buffer, handler) { |
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.
Thanks. Fixed.
Addressed the nit. Please take another look. |
This test executes a simple debug session over the inspector protocol.
Relaunched CI: https://ci.nodejs.org/job/node-test-pull-request/4129/ |
This test executes a simple debug session over the inspector protocol. PR-URL: #8429 Reviewed-By: ofrobots - Ali Ijaz Sheikh <[email protected]>
Thanks. Landed as b4a249f. |
Just got a failure for this test on CI: https://ci.nodejs.org/job/node-test-commit-linux/5205/nodes=centos5-32/tapTestReport/test.tap-1174/
|
@Trott How do I run this test locally? Looking at the output, it could be that this is simply a timeout while the node is shutting down. Are there any standards for how long the test can wait on failure? |
@eugeneo On the stress test, it looks like it's failing about one out of every 50 runs on CentOS 5 (32-bit). So you'll probably want to put that in a loop or something. |
It is not failing on my Ubuntu 64 workstation. Can you try this commit - https://github.com/eugeneo/node/commit/542c02348a5f2236f0c98c719067790a0a0d6332 |
Here you go. This time, the test timed out after 8 successful runs.
|
I should mention that the timeout is enforced by |
Thank you for looking into this. I still have no idea where this failure is coming from... What I see in the trace is that the test does not get notification when the child process exits. I do not know if the child process exits. I uploaded a new commit - https://github.com/eugeneo/node/commit/972120d1dcd1d6c0913c56a98f7048b7d3cb8466 - that should indicate if the child exits. Can we try it on CentOS? Note that this commit adds some tracing and thus breaks some tests other then test-inspector. Is there a way for me to access one of the machines where the failure occurs? |
Not sure what the process is, but that would be something handled by the Build working group. @nodejs/build |
I queued up the test in Jenkins but it's waiting on a host to become available, I think.... Coming soon, though... |
Thank you! This was most helpful - looks like the child node does not actually exit, which is a bug. I'm looking into it. |
Because the Jenkins results get cleared out from time to time, here's the result, in case someone needs to refer back to it later:
|
#8669 was created for this issue, I will be posting patches there. |
@gibfahn I cannot reproduce it outside of the CI - I just ran it again on my Ubuntu 64 system... |
This test executes a simple debug session over the inspector protocol. PR-URL: nodejs#8429 Reviewed-By: ofrobots - Ali Ijaz Sheikh <[email protected]>
This test executes a simple debug session over the inspector protocol. PR-URL: #8429 Reviewed-By: ofrobots - Ali Ijaz Sheikh <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
Adds a new test case that checks the inspector
Description of change
This test executes a simple debug session over the inspector protocol.
CC: @ofrobots