-
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: add test for postmortem metadata validation #17685
Conversation
cc @nodejs/diagnostics @nodejs/post-mortem |
Perhaps on Windows we could use |
Nit: Maybe include a comment at the top of the test explaining what the test does? |
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 have some misgivings about this test:
-
It only catches deletions, not semantic changes. Some might say "better than nothing" but I say "false sense of security." Integration testing with llnode's test suite will give better results.
-
It's going to be tempting to just add everything from
nm node | grep v8dbg
even though llnode and mbd use only a fraction of it. That's not useful, just maintenance make-work, but so is updating it after every llnode or mdb change. -
Who is going to fix it when it starts failing and in what time frame? I've mentioned elsewhere that I don't think updating the metadata script should be the responsibility of the V8 upgrader. Neither should it block upgrades.
if (nm.error && nm.error.errno === 'ENOENT') | ||
common.skip('nm not found on system'); | ||
|
||
const symbolRe = /\s(_v8dbg_.+)$/; |
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.
The underscore prefix is a macos-ism.
@bnoordhuis regarding your second point - I thought of that, and I've only added the metadata used by the most recent version of llnode. I just haven't pushed it up yet because there is already a missing constant. Regarding your first point - I agree that test suite integration would be more in depth. UPDATE: pushed this up. The missing constant was |
5120567
to
96fc168
Compare
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 with the underscore prefix removed. Also we should mark this as flaky to avoid blocking V8 upgrades while being able to get notified when the constants were missing.
cc @nodejs/post-mortem |
dfd6168
to
8efc0a5
Compare
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 if you mark it FLAKY.
const symbols = nm.stdout.toString().split('\n').map((line) => { | ||
const match = line.match(symbolRe); | ||
|
||
return match && match[1].replace(/^_/, ''); |
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.
The _
isn't captured, the replace is a no-op.
8efc0a5
to
e70a787
Compare
|
-bash-4.3$ nm /tmp/usenode.riclau/node-v8.9.3-aix-ppc64/bin/node
0654-210 /tmp/usenode.riclau/node-v8.9.3-aix-ppc64/bin/node is not valid in the current object file mode.
Use the -X option to specify the desired object mode.
-bash-4.3$
So probably want either
instead of (with
cc @nodejs/platform-aix |
e70a787
to
f6000f9
Compare
Thanks @richardlau! CI with your suggestions: |
b05f5d2
to
5708da8
Compare
All nits should be addressed. Also replaced a |
This commit adds a test to validate postmortem debugging metadata. When this test runs, it can check for the presence of metadata constants used by tools such as llnode and mdb and report if any have accidentally been removed. PR-URL: nodejs#17685 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
5708da8
to
68c63a9
Compare
This commit adds a test to validate postmortem debugging metadata. When this test runs, it can check for the presence of metadata constants used by tools such as llnode and mdb and report if any have accidentally been removed. PR-URL: #17685 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This commit adds a test to validate postmortem debugging metadata. When this test runs, it can check for the presence of metadata constants used by tools such as llnode and mdb and report if any have accidentally been removed. PR-URL: #17685 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This commit adds a test to validate postmortem debugging metadata. When this test runs, it can check for the presence of metadata constants used by tools such as llnode and mdb and report if any have accidentally been removed. PR-URL: nodejs/node#17685 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This lands cleanly on v8.x and the tests pass so I landed in on to staging. For v6.x it was easy to resolve the conflict but tests failed locally
Looks like it might be a pain to backport. Feel free to put |
This commit adds a test to validate postmortem debugging metadata. When this test runs, it can check for the presence of metadata constants used by tools such as llnode and mdb and report if any have accidentally been removed. PR-URL: #17685 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This commit adds a test to validate postmortem debugging metadata. When this test runs, it can check for the presence of metadata constants used by tools such as llnode and mdb and report if any have accidentally been removed. PR-URL: #17685 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
test-postmortem-metadata does not ever seem to fail on master. According to Michaël Zasso, when it fails locally for him during a V8 upgrade, he pings Colin Ihrig who fixes it almost immediately. There was some discussion about marking it flaky when it first landed but it's not clear to me that it is necessary. (We can always mark it flaky again if it turns out that it is necessary.) The reason I want this test removed from the status file for flaky tests is that I believe that file can and should be used as a list of tests to fix. But this test doesn't need any fixing. Refs: nodejs#17685
This commit adds a test to validate postmortem debugging metadata. When this test runs, it can check for the presence of metadata constants used by tools such as llnode and mdb and report if any have accidentally been removed. PR-URL: #17685 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This commit adds a test to validate postmortem debugging metadata. When this test runs, it can check for the presence of metadata constants used by tools such as llnode and mdb and report if any have accidentally been removed. PR-URL: #17685 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This commit adds a test to validate postmortem metadata. There are a lot more constants to be added, but I wanted to get feedback on the idea before spending the time on all of the constants.
The idea is that we can include a list of metadata constants used by llnode, mdb_v8, and any other postmortem tools (if there are any). When this test runs, it will let us know if the constants have gone missing. Currently, we only find that out if the ustack helper compilation breaks, or someone reports a bug to llnode/mdb_v8.
This test doesn't need to run on all platforms (it currently depends on
nm
), but it would be great if it ran on at least one platform that the V8 team tests on.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test