Skip to content

Commit af457ac

Browse files
committed
test(node): Assert the tunnel request sends no server span at all
1 parent 3e063e4 commit af457ac

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • dev-packages/node-integration-tests/suites/tracing/managed-tunnel

‎dev-packages/node-integration-tests/suites/tracing/managed-tunnel/test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { URL_PATH } from '@sentry/conventions/attributes';
12
import { getTunnelPath } from '@sentry/core';
23
import { afterAll, describe, expect } from 'vitest';
34
import { cleanupChildProcesses, createEsmAndCjsTests } from '../../../utils/runner';
@@ -12,9 +13,9 @@ describe('managed tunnel', () => {
1213
const runner = createRunner()
1314
.expect({
1415
span: container => {
15-
// Spans flush in order, so a span for the tunnel request would arrive before this one.
16-
const serverSpan = container.items.find(item => item.is_segment);
17-
expect(serverSpan?.attributes['url.path']).toEqual({ type: 'string', value: '/after-tunnel' });
16+
// Spans flush in order, so a span for the tunnel request would arrive in this container or before it.
17+
const segmentPaths = container.items.filter(item => item.is_segment).map(item => item.attributes[URL_PATH]);
18+
expect(segmentPaths).toEqual([{ type: 'string', value: '/after-tunnel' }]);
1819
},
1920
})
2021
.start();

0 commit comments

Comments
 (0)