Skip to content

Commit 4a5f90b

Browse files
JPeer264claude
andauthored
test: Fix flaky ANR test by increasing blocking duration (#20239)
Closes #20215 Closes [JS-2120](https://linear.app/getsentry/issue/JS-2120/flaky-ci-node-24-node-core-integration-tests) Increase `longWork` iterations from 20 to 50 to ensure the blocking function is more likely to be captured in ANR stack sampling, reducing flakiness from sampling during timer processing. A rerun solved it, but this would hopefully make it less flaky. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 95b1e95 commit 4a5f90b

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

dev-packages/node-core-integration-tests/suites/anr/app-path.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Sentry.setUser({ email: 'person@home.com' });
2525
Sentry.addBreadcrumb({ message: 'important message!' });
2626

2727
function longWork() {
28-
for (let i = 0; i < 20; i++) {
28+
for (let i = 0; i < 50; i++) {
2929
const salt = crypto.randomBytes(128).toString('base64');
3030
const hash = crypto.pbkdf2Sync('myPassword', salt, 10000, 512, 'sha512');
3131
assert.ok(hash);

dev-packages/node-core-integration-tests/suites/anr/basic-multiple.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Sentry.setUser({ email: 'person@home.com' });
2121
Sentry.addBreadcrumb({ message: 'important message!' });
2222

2323
function longWork() {
24-
for (let i = 0; i < 20; i++) {
24+
for (let i = 0; i < 50; i++) {
2525
const salt = crypto.randomBytes(128).toString('base64');
2626
const hash = crypto.pbkdf2Sync('myPassword', salt, 10000, 512, 'sha512');
2727
assert.ok(hash);

dev-packages/node-core-integration-tests/suites/anr/basic-session.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Sentry.setUser({ email: 'person@home.com' });
2020
Sentry.addBreadcrumb({ message: 'important message!' });
2121

2222
function longWork() {
23-
for (let i = 0; i < 20; i++) {
23+
for (let i = 0; i < 50; i++) {
2424
const salt = crypto.randomBytes(128).toString('base64');
2525
const hash = crypto.pbkdf2Sync('myPassword', salt, 10000, 512, 'sha512');
2626
assert.ok(hash);

dev-packages/node-core-integration-tests/suites/anr/basic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Sentry.setUser({ email: 'person@home.com' });
2222
Sentry.addBreadcrumb({ message: 'important message!' });
2323

2424
function longWork() {
25-
for (let i = 0; i < 20; i++) {
25+
for (let i = 0; i < 50; i++) {
2626
const salt = crypto.randomBytes(128).toString('base64');
2727
const hash = crypto.pbkdf2Sync('myPassword', salt, 10000, 512, 'sha512');
2828
assert.ok(hash);

dev-packages/node-core-integration-tests/suites/anr/basic.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Sentry.setUser({ email: 'person@home.com' });
2121
Sentry.addBreadcrumb({ message: 'important message!' });
2222

2323
function longWork() {
24-
for (let i = 0; i < 20; i++) {
24+
for (let i = 0; i < 50; i++) {
2525
const salt = crypto.randomBytes(128).toString('base64');
2626
const hash = crypto.pbkdf2Sync('myPassword', salt, 10000, 512, 'sha512');
2727
assert.ok(hash);

dev-packages/node-core-integration-tests/suites/anr/forked.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Sentry.setUser({ email: 'person@home.com' });
2121
Sentry.addBreadcrumb({ message: 'important message!' });
2222

2323
function longWork() {
24-
for (let i = 0; i < 20; i++) {
24+
for (let i = 0; i < 50; i++) {
2525
const salt = crypto.randomBytes(128).toString('base64');
2626
const hash = crypto.pbkdf2Sync('myPassword', salt, 10000, 512, 'sha512');
2727
assert.ok(hash);

dev-packages/node-core-integration-tests/suites/anr/isolated.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ setupOtel(client);
1818
async function longWork() {
1919
await new Promise(resolve => setTimeout(resolve, 1000));
2020

21-
for (let i = 0; i < 20; i++) {
21+
for (let i = 0; i < 50; i++) {
2222
const salt = crypto.randomBytes(128).toString('base64');
2323
const hash = crypto.pbkdf2Sync('myPassword', salt, 10000, 512, 'sha512');
2424
assert.ok(hash);

dev-packages/node-core-integration-tests/suites/anr/stop-and-start.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ Sentry.setUser({ email: 'person@home.com' });
2323
Sentry.addBreadcrumb({ message: 'important message!' });
2424

2525
function longWorkIgnored() {
26-
for (let i = 0; i < 20; i++) {
26+
for (let i = 0; i < 50; i++) {
2727
const salt = crypto.randomBytes(128).toString('base64');
2828
const hash = crypto.pbkdf2Sync('myPassword', salt, 10000, 512, 'sha512');
2929
assert.ok(hash);
3030
}
3131
}
3232

3333
function longWork() {
34-
for (let i = 0; i < 20; i++) {
34+
for (let i = 0; i < 50; i++) {
3535
const salt = crypto.randomBytes(128).toString('base64');
3636
const hash = crypto.pbkdf2Sync('myPassword', salt, 10000, 512, 'sha512');
3737
assert.ok(hash);

0 commit comments

Comments
 (0)