Skip to content

Commit 315373d

Browse files
authored
Merge branch 'develop' into fix/langchain-callbackmanager-preservation
2 parents 745b9e1 + 0b302f9 commit 315373d

29 files changed

Lines changed: 264 additions & 124 deletions

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
66

7-
Work in this release was contributed by @abcang, @ahmadio, and @victorgarciaesgi. Thank you for your contributions!
7+
Work in this release was contributed by @abcang, @ahmadio, @victorgarciaesgi, and @delorge. Thank you for your contributions!
88

99
- **feat(core): Support array attributes for spans, logs, and metrics ([#20427](https://github.com/getsentry/sentry-javascript/pull/20427))**
1010

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const Sentry = require('@sentry/node-core');
22
const { setupOtel } = require('../../../utils/setupOtel.js');
3+
const { expectProcessToExit } = require('../../../utils/expect-process-to-exit');
34

45
const client = Sentry.init({
56
dsn: 'https://public@dsn.ingest.sentry.io/1337',
@@ -11,9 +12,6 @@ process.on('uncaughtException', () => {
1112
// do nothing - this will prevent the Error below from closing this process before the timeout resolves
1213
});
1314

14-
setTimeout(() => {
15-
process.stdout.write("I'm alive!");
16-
process.exit(0);
17-
}, 500);
15+
expectProcessToExit();
1816

1917
throw new Error();

dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/mimic-native-behaviour-additional-listener-test-script.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const Sentry = require('@sentry/node-core');
22
const { setupOtel } = require('../../../utils/setupOtel.js');
3+
const { expectProcessToExit } = require('../../../utils/expect-process-to-exit');
34

45
const client = Sentry.init({
56
dsn: 'https://public@dsn.ingest.sentry.io/1337',
@@ -16,9 +17,6 @@ process.on('uncaughtException', () => {
1617
// do nothing - this will prevent the Error below from closing this process before the timeout resolves
1718
});
1819

19-
setTimeout(() => {
20-
process.stdout.write("I'm alive!");
21-
process.exit(0);
22-
}, 500);
20+
expectProcessToExit();
2321

2422
throw new Error();
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const Sentry = require('@sentry/node-core');
22
const { setupOtel } = require('../../../utils/setupOtel.js');
3+
const { expectProcessToExit } = require('../../../utils/expect-process-to-exit');
34

45
const client = Sentry.init({
56
dsn: 'https://public@dsn.ingest.sentry.io/1337',
@@ -12,11 +13,6 @@ const client = Sentry.init({
1213

1314
setupOtel(client);
1415

15-
setTimeout(() => {
16-
// This should not be called because the script throws before this resolves.
17-
// Using 3000ms to account for the SDK's 2000ms shutdown timeout + buffer.
18-
process.stdout.write("I'm alive!");
19-
process.exit(0);
20-
}, 3000);
16+
expectProcessToExit();
2117

2218
throw new Error();
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
const Sentry = require('@sentry/node-core');
22
const { setupOtel } = require('../../../utils/setupOtel.js');
3+
const { expectProcessToExit } = require('../../../utils/expect-process-to-exit');
34

45
const client = Sentry.init({
56
dsn: 'https://public@dsn.ingest.sentry.io/1337',
67
});
78

89
setupOtel(client);
910

10-
setTimeout(() => {
11-
// This should not be called because the script throws before this resolves.
12-
// Using 3000ms to account for the SDK's 2000ms shutdown timeout + buffer.
13-
process.stdout.write("I'm alive!");
14-
process.exit(0);
15-
}, 3000);
11+
expectProcessToExit();
1612

1713
throw new Error();
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const Sentry = require('@sentry/node-core');
22
const { setupOtel } = require('../../../utils/setupOtel.js');
3+
const { expectProcessToExit } = require('../../../utils/expect-process-to-exit');
34

45
const client = Sentry.init({
56
dsn: 'https://public@dsn.ingest.sentry.io/1337',
@@ -8,9 +9,6 @@ const client = Sentry.init({
89

910
setupOtel(client);
1011

11-
setTimeout(() => {
12-
process.stdout.write("I'm alive!");
13-
process.exit(0);
14-
}, 500);
12+
expectProcessToExit();
1513

1614
Promise.reject('test rejection');
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const Sentry = require('@sentry/node-core');
22
const { setupOtel } = require('../../../utils/setupOtel.js');
3+
const { expectProcessToExit } = require('../../../utils/expect-process-to-exit');
34

45
const client = Sentry.init({
56
dsn: 'https://public@dsn.ingest.sentry.io/1337',
@@ -8,10 +9,6 @@ const client = Sentry.init({
89

910
setupOtel(client);
1011

11-
setTimeout(() => {
12-
// should not be called
13-
process.stdout.write("I'm alive!");
14-
process.exit(0);
15-
}, 500);
12+
expectProcessToExit();
1613

1714
Promise.reject('test rejection');
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
const Sentry = require('@sentry/node-core');
22
const { setupOtel } = require('../../../utils/setupOtel.js');
3+
const { expectProcessToExit } = require('../../../utils/expect-process-to-exit');
34

45
const client = Sentry.init({
56
dsn: 'https://public@dsn.ingest.sentry.io/1337',
67
});
78

89
setupOtel(client);
910

10-
setTimeout(() => {
11-
process.stdout.write("I'm alive!");
12-
process.exit(0);
13-
}, 500);
11+
expectProcessToExit();
1412

1513
Promise.reject(new Error('test rejection'));
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
const Sentry = require('@sentry/node-core');
22
const { setupOtel } = require('../../../utils/setupOtel.js');
3+
const { expectProcessToExit } = require('../../../utils/expect-process-to-exit');
34

45
const client = Sentry.init({
56
dsn: 'https://public@dsn.ingest.sentry.io/1337',
67
});
78

89
setupOtel(client);
910

10-
setTimeout(() => {
11-
process.stdout.write("I'm alive!");
12-
process.exit(0);
13-
}, 500);
11+
expectProcessToExit();
1412

1513
Promise.reject('test rejection');
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Sets a watchdog timer that prints "I'm alive!" and exits if the process
3+
* doesn't terminate before the timeout. Uses 3000ms to account for the
4+
* SDK's 2000ms shutdown timeout + buffer.
5+
*/
6+
function expectProcessToExit() {
7+
setTimeout(() => {
8+
process.stdout.write("I'm alive!");
9+
process.exit(0);
10+
}, 3000);
11+
}
12+
13+
module.exports = { expectProcessToExit };

0 commit comments

Comments
 (0)