Skip to content

Commit 72e9912

Browse files
committed
Use collectStreamedSpansUntilSegment
1 parent db3402a commit 72e9912

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

  • dev-packages/e2e-tests/test-applications/astro-6-cf-workers/tests

‎dev-packages/e2e-tests/test-applications/astro-6-cf-workers/tests/db.test.ts‎

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
import { expect, test } from '@playwright/test';
2-
import { collectStreamedSpans, getSpanOp } from '@sentry-internal/test-utils';
2+
import { collectStreamedSpansUntilSegment, getSpanOp } from '@sentry-internal/test-utils';
33

44
const APP_NAME = 'astro-6-cf-workers';
55

66
test('a real mysql query emits a db span with orchestrion-channel attributes', async ({ request }) => {
7-
const spansPromise = collectStreamedSpans(
8-
APP_NAME,
9-
spans =>
10-
spans.some(span => getSpanOp(span) === 'http.server' && span.is_segment) &&
11-
spans.some(span => getSpanOp(span) === 'db'),
12-
);
7+
const spansPromise = collectStreamedSpansUntilSegment(APP_NAME, 'GET /db-mysql');
138

149
const res = await request.get('/db-mysql');
1510
expect(res.status()).toBe(200);
@@ -31,12 +26,7 @@ test('a real mysql query emits a db span with orchestrion-channel attributes', a
3126
});
3227

3328
test('a nested query lands on the same trace (async context restored)', async ({ request }) => {
34-
const spansPromise = collectStreamedSpans(
35-
APP_NAME,
36-
spans =>
37-
spans.some(span => getSpanOp(span) === 'http.server' && span.is_segment) &&
38-
spans.filter(span => getSpanOp(span) === 'db').length >= 2,
39-
);
29+
const spansPromise = collectStreamedSpansUntilSegment(APP_NAME, 'GET /db-mysql');
4030

4131
const res = await request.get('/db-mysql');
4232
expect(res.status()).toBe(200);

0 commit comments

Comments
 (0)