From 6911a290b58d536183df856f11ab57129e231a1b Mon Sep 17 00:00:00 2001 From: Andrei Borza Date: Fri, 4 Sep 2026 14:08:49 +0200 Subject: [PATCH] test(e2e): Use `collectStreamedSpansUntilSegment` in the create-remix-app-v2 db specs The segment span ends last, so waiting for it is enough; the explicit child-span count was redundant. --- .../create-remix-app-v2/tests/db.test.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/db.test.ts index 52d3c69d8f61..2fae830957cd 100644 --- a/dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/db.test.ts @@ -1,20 +1,16 @@ import { expect, test } from '@playwright/test'; import type { SerializedStreamedSpan } from '@sentry-internal/test-utils'; -import { collectStreamedSpans, getSpanOp } from '@sentry-internal/test-utils'; +import { collectStreamedSpansUntilSegment, getSpanOp } from '@sentry-internal/test-utils'; function isSegmentFor(path: string): (span: SerializedStreamedSpan) => boolean { - return span => getSpanOp(span) === 'http.server' && span.is_segment && span.attributes['url.path']?.value === path; + return span => getSpanOp(span) === 'http.server' && span.attributes['url.path']?.value === path; } // Orchestrion force-bundles + transforms mysql/ioredis at build time, and the databases // are booted via docker-compose in the Playwright global setup. test.describe('orchestrion DB instrumentation', () => { test('Instruments ioredis automatically via orchestrion', async ({ baseURL }) => { - const spansPromise = collectStreamedSpans( - 'create-remix-app-v2', - spans => - spans.some(isSegmentFor('/db-ioredis')) && spans.filter(span => getSpanOp(span) === 'db.query').length >= 2, - ); + const spansPromise = collectStreamedSpansUntilSegment('create-remix-app-v2', isSegmentFor('/db-ioredis')); await fetch(`${baseURL}/db-ioredis`); @@ -48,10 +44,7 @@ test.describe('orchestrion DB instrumentation', () => { }); test('Instruments mysql automatically via orchestrion', async ({ baseURL }) => { - const spansPromise = collectStreamedSpans( - 'create-remix-app-v2', - spans => spans.some(isSegmentFor('/db-mysql')) && spans.filter(span => getSpanOp(span) === 'db').length >= 2, - ); + const spansPromise = collectStreamedSpansUntilSegment('create-remix-app-v2', isSegmentFor('/db-mysql')); await fetch(`${baseURL}/db-mysql`);