-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bootstrap: add exception handling for profiler bootstrap
Add exception handling for the case when profile is not bootstrapped when coverage is enabled. Fixes: #29542 PR-URL: #29552 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
- Loading branch information
Showing
3 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
common.skipIfInspectorEnabled(); | ||
|
||
const fixtures = require('../common/fixtures'); | ||
const assert = require('assert'); | ||
const { spawnSync } = require('child_process'); | ||
const env = { ...process.env, NODE_V8_COVERAGE: '/foo/bar' }; | ||
const childPath = fixtures.path('v8-coverage/subprocess'); | ||
const { status, stderr } = spawnSync( | ||
process.execPath, | ||
[childPath], | ||
{ env } | ||
); | ||
|
||
const warningMessage = 'The inspector is disabled, ' + | ||
'coverage could not be collected'; | ||
|
||
assert.strictEqual(status, 0); | ||
assert.strictEqual( | ||
stderr.toString().includes(`Warning: ${warningMessage}`), | ||
true | ||
); |