Skip to content

Commit b6e5ea9

Browse files
committed
fix integration test (not our fault but express instrumentation changed)
1 parent 53f5d9c commit b6e5ea9

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

dev-packages/node-integration-tests/suites/tracing/ignoreSpans-streamed/children/instrument.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ Sentry.init({
77
tracesSampleRate: 1.0,
88
transport: loggingTransport,
99
traceLifecycle: 'stream',
10-
ignoreSpans: ['middleware - expressInit', /custom-to-drop/, { op: 'ignored-op' }],
10+
ignoreSpans: ['expressInit', /custom-to-drop/, { op: 'ignored-op' }],
1111
clientReportFlushInterval: 1_000,
1212
});

dev-packages/node-integration-tests/suites/tracing/ignoreSpans-streamed/children/server.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ app.get('/test/express', (_req, res) => {
3838
() => {},
3939
);
4040
res.send({ response: 'response 1' });
41+
42+
setTimeout(() => {
43+
// flush to avoid waiting for the span buffer timeout to send spans
44+
// but defer it to the next tick to let the SDK finish the http.server span first.
45+
Sentry.flush();
46+
});
4147
});
4248

4349
Sentry.setupExpressErrorHandler(app);

dev-packages/node-integration-tests/suites/tracing/ignoreSpans-streamed/segments/server.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ app.get('/health', (_req, res) => {
1313

1414
app.get('/ok', (_req, res) => {
1515
res.send({ status: 'ok' });
16+
setTimeout(() => {
17+
// flush to avoid waiting for the span buffer timeout to send spans
18+
// but defer it to the next tick to let the SDK finish the http.server span first.
19+
Sentry.flush();
20+
});
1621
});
1722

1823
Sentry.setupExpressErrorHandler(app);

0 commit comments

Comments
 (0)