-
-
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.
- Loading branch information
Showing
3 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
dev-packages/node-integration-tests/suites/anr/basic-multiple.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 Sentry from '@sentry/node'; | ||
|
||
global._sentryDebugIds = { [new Error().stack]: 'aaaaaaaa-aaaa-4aaa-aaaa-aaaaaaaaaa' }; | ||
|
||
setTimeout(() => { | ||
process.exit(); | ||
}, 10000); | ||
|
||
Sentry.init({ | ||
dsn: process.env.SENTRY_DSN, | ||
release: '1.0', | ||
autoSessionTracking: false, | ||
integrations: [Sentry.anrIntegration({ captureStackTrace: true, anrThreshold: 100, maxAnrEvents: 2 })], | ||
}); | ||
|
||
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); | ||
|
||
setTimeout(() => { | ||
longWork(); | ||
}, 4000); |
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