From da6a93b32c6fc3b9b2706294e30c5e265b7c6d00 Mon Sep 17 00:00:00 2001 From: JPeer264 Date: Tue, 19 May 2026 13:28:50 +0200 Subject: [PATCH] fix(node): Increase timeout in OnUncaughtException test scripts to fix 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 --- ...ic-native-behaviour-no-additional-listener-test-script.js | 5 +++-- .../no-additional-listener-test-script.js | 5 +++-- ...ic-native-behaviour-no-additional-listener-test-script.js | 5 +++-- .../no-additional-listener-test-script.js | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/mimic-native-behaviour-no-additional-listener-test-script.js b/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/mimic-native-behaviour-no-additional-listener-test-script.js index bc8fc1f8c898..117e84b41130 100644 --- a/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/mimic-native-behaviour-no-additional-listener-test-script.js +++ b/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/mimic-native-behaviour-no-additional-listener-test-script.js @@ -13,9 +13,10 @@ const client = Sentry.init({ setupOtel(client); setTimeout(() => { - // This should not be called because the script throws before this resolves + // This should not be called because the script throws before this resolves. + // Using 3000ms to account for the SDK's 2000ms shutdown timeout + buffer. process.stdout.write("I'm alive!"); process.exit(0); -}, 500); +}, 3000); throw new Error(); diff --git a/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/no-additional-listener-test-script.js b/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/no-additional-listener-test-script.js index 513eb3abc7cb..0d7a8a4d7604 100644 --- a/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/no-additional-listener-test-script.js +++ b/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/no-additional-listener-test-script.js @@ -8,9 +8,10 @@ const client = Sentry.init({ setupOtel(client); setTimeout(() => { - // This should not be called because the script throws before this resolves + // This should not be called because the script throws before this resolves. + // Using 3000ms to account for the SDK's 2000ms shutdown timeout + buffer. process.stdout.write("I'm alive!"); process.exit(0); -}, 500); +}, 3000); throw new Error(); diff --git a/dev-packages/node-integration-tests/suites/public-api/OnUncaughtException/mimic-native-behaviour-no-additional-listener-test-script.js b/dev-packages/node-integration-tests/suites/public-api/OnUncaughtException/mimic-native-behaviour-no-additional-listener-test-script.js index e1a78cce10c8..a0e1480596e4 100644 --- a/dev-packages/node-integration-tests/suites/public-api/OnUncaughtException/mimic-native-behaviour-no-additional-listener-test-script.js +++ b/dev-packages/node-integration-tests/suites/public-api/OnUncaughtException/mimic-native-behaviour-no-additional-listener-test-script.js @@ -10,9 +10,10 @@ Sentry.init({ }); setTimeout(() => { - // This should not be called because the script throws before this resolves + // This should not be called because the script throws before this resolves. + // Using 3000ms to account for the SDK's 2000ms shutdown timeout + buffer. process.stdout.write("I'm alive!"); process.exit(0); -}, 500); +}, 3000); throw new Error(); diff --git a/dev-packages/node-integration-tests/suites/public-api/OnUncaughtException/no-additional-listener-test-script.js b/dev-packages/node-integration-tests/suites/public-api/OnUncaughtException/no-additional-listener-test-script.js index fcff5962b629..8cc7c44ef20f 100644 --- a/dev-packages/node-integration-tests/suites/public-api/OnUncaughtException/no-additional-listener-test-script.js +++ b/dev-packages/node-integration-tests/suites/public-api/OnUncaughtException/no-additional-listener-test-script.js @@ -5,9 +5,10 @@ Sentry.init({ }); setTimeout(() => { - // This should not be called because the script throws before this resolves + // This should not be called because the script throws before this resolves. + // Using 3000ms to account for the SDK's 2000ms shutdown timeout + buffer. process.stdout.write("I'm alive!"); process.exit(0); -}, 500); +}, 3000); throw new Error();