Skip to content

test(node): Increase timeout in OnUncaughtException test scripts to fix flaky CI#21002

Merged
JPeer264 merged 1 commit into
developfrom
jp/node-flaky-unhandled-error
May 19, 2026
Merged

test(node): Increase timeout in OnUncaughtException test scripts to fix flaky CI#21002
JPeer264 merged 1 commit into
developfrom
jp/node-flaky-unhandled-error

Conversation

@JPeer264

Copy link
Copy Markdown
Member

closes #20796
closes JS-2432

closes #20698
closes JS-2368

closes #20689
closes JS-2363

closes #20974
closes JS-2531

closes #20798
closes JS-2434

closes #20792
closes JS-2430

closes #20788
closes JS-2428

The 500ms timeout was too short - when network conditions cause the SDK's client.close() to take longer than 500ms (it has a 2000ms timeout), the watchdog fires first and the test fails with "I'm alive!" in stdout.

This can be reproduced with the following script:

const Sentry = require('@sentry/node');

Sentry.init({
  dsn: 'https://public@10.255.255.1/1337',  // Unreachable IP - simulates slow network
});

setTimeout(() => {
  process.stdout.write("I'm alive!");
  process.exit(0);
}, 3000);  // Was 500ms before the fix

throw new Error('Test');

…x flaky CI

The 500ms timeout was too short - when network conditions cause the SDK's
client.close() to take longer than 500ms (it has a 2000ms timeout), the
watchdog fires first and the test fails with "I'm alive!" in stdout.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@JPeer264 JPeer264 requested a review from a team May 19, 2026 12:04
@JPeer264 JPeer264 self-assigned this May 19, 2026
@JPeer264 JPeer264 requested a review from a team as a code owner May 19, 2026 12:04
@linear-code

linear-code Bot commented May 19, 2026

Copy link
Copy Markdown

@JPeer264 JPeer264 merged commit e1351f7 into develop May 19, 2026
54 checks passed
@JPeer264 JPeer264 deleted the jp/node-flaky-unhandled-error branch May 19, 2026 12:22
This was referenced May 20, 2026
JPeer264 added a commit that referenced this pull request May 21, 2026
#21038)

closes #20697
closes
[JS-2367](https://linear.app/getsentry/issue/JS-2367/flaky-ci-node-22-integration-tests-suitespublic)

closes #20791
closes [JS-2429](https://linear.app/getsentry/issue/JS-2429)

closes #20804
closes [JS-2435](https://linear.app/getsentry/issue/JS-2435)

Follow up to: #21002

This one basically does the same, but changes it for all tests with that
and outsources this into its own test util helper.

---

Claude text:

Extract `expectProcessToExit()` helper to consolidate watchdog timeout
logic. Uses 3000ms to account for SDK's 2000ms shutdown timeout +
buffer, fixing race conditions that caused flaky CI failures.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment