11import { expect , test } from '@playwright/test' ;
2- import { collectStreamedSpans , getSpanOp } from '@sentry-internal/test-utils' ;
2+ import { collectStreamedSpansUntilSegment , getSpanOp } from '@sentry-internal/test-utils' ;
33
44const APP_NAME = 'astro-6-cf-workers' ;
55
66test ( '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
3328test ( '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