-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(v8/node): Correctly resolve debug IDs for ANR events with custom …
- Loading branch information
Showing
3 changed files
with
70 additions
and
9 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
dev-packages/node-integration-tests/suites/anr/app-path.mjs
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,36 @@ | ||
import * as assert from 'assert'; | ||
import * as crypto from 'crypto'; | ||
import * as path from 'path'; | ||
import * as url from 'url'; | ||
|
||
import * as Sentry from '@sentry/node'; | ||
|
||
global._sentryDebugIds = { [new Error().stack]: 'aaaaaaaa-aaaa-4aaa-aaaa-aaaaaaaaaa' }; | ||
|
||
const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); | ||
|
||
setTimeout(() => { | ||
process.exit(); | ||
}, 10000); | ||
|
||
Sentry.init({ | ||
dsn: process.env.SENTRY_DSN, | ||
release: '1.0', | ||
autoSessionTracking: false, | ||
integrations: [Sentry.anrIntegration({ captureStackTrace: true, anrThreshold: 100, appRootPath: __dirname })], | ||
}); | ||
|
||
Sentry.setUser({ email: '[email protected]' }); | ||
Sentry.addBreadcrumb({ message: 'important message!' }); | ||
|
||
function longWork() { | ||
for (let i = 0; i < 20; i++) { | ||
const salt = crypto.randomBytes(128).toString('base64'); | ||
const hash = crypto.pbkdf2Sync('myPassword', salt, 10000, 512, 'sha512'); | ||
assert.ok(hash); | ||
} | ||
} | ||
|
||
setTimeout(() => { | ||
longWork(); | ||
}, 1000); |
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