-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
src: disconnect inspector before exiting out of fatal exception #29611
Changes from 2 commits
83fc7ad
35b3eb9
07c3ae3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const a = 99; | ||
if (true) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no point of adding else block There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is in the test though? |
||
const b = 101; | ||
} else { | ||
const c = 102; | ||
} | ||
throw new Error('test'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,24 @@ function nextdir() { | |
assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); | ||
} | ||
|
||
// Outputs coverage when process.exit(1) exits process. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perhaps, change to:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uh thanks for catching my copy-past error :) |
||
{ | ||
const coverageDirectory = path.join(tmpdir.path, nextdir()); | ||
const output = spawnSync(process.execPath, [ | ||
require.resolve('../fixtures/v8-coverage/throw') | ||
], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); | ||
if (output.status !== 1) { | ||
console.log(output.stderr.toString()); | ||
} | ||
assert.strictEqual(output.status, 1); | ||
const fixtureCoverage = getFixtureCoverage('throw.js', coverageDirectory); | ||
assert.ok(fixtureCoverage, 'coverage not found for file'); | ||
// First branch executed. | ||
assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); | ||
// Second branch did not execute. | ||
assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); | ||
} | ||
|
||
// Outputs coverage when process.exit(1) exits process. | ||
{ | ||
const coverageDirectory = path.join(tmpdir.path, nextdir()); | ||
|
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.
Uh just realized we should call
profiler::EndStartedProfilers
instead since the wholeWaitForInspectorDisconnect
resets signals.