Skip to content

Commit e27c3a3

Browse files
committed
unflake tests
1 parent 874dea9 commit e27c3a3

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

dev-packages/browser-integration-tests/suites/tracing/request/fetch/test.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { expect } from '@playwright/test';
2-
import type { Event } from '@sentry/core';
3-
42
import { sentryTest } from '../../../../utils/fixtures';
5-
import { getMultipleSentryEnvelopeRequests, shouldSkipTracingTest } from '../../../../utils/helpers';
3+
import {
4+
envelopeRequestParser,
5+
shouldSkipTracingTest,
6+
waitForTransactionRequestOnUrl,
7+
} from '../../../../utils/helpers';
68

79
sentryTest('should create spans for fetch requests', async ({ getLocalTestUrl, page }) => {
810
if (shouldSkipTracingTest()) {
@@ -11,14 +13,8 @@ sentryTest('should create spans for fetch requests', async ({ getLocalTestUrl, p
1113

1214
const url = await getLocalTestUrl({ testDir: __dirname });
1315

14-
// Because we fetch from http://example.com, fetch will throw a CORS error in firefox and webkit.
15-
// Chromium does not throw for cors errors.
16-
// This means that we will intercept a dynamic amount of envelopes here.
17-
18-
// We will wait 500ms for all envelopes to be sent. Generally, in all browsers, the last sent
19-
// envelope contains tracing data.
20-
const envelopes = await getMultipleSentryEnvelopeRequests<Event>(page, 4, { url, timeout: 10000 });
21-
const tracingEvent = envelopes.find(event => event.type === 'transaction')!; // last envelope contains tracing data on all browsers
16+
const req = await waitForTransactionRequestOnUrl(page, url);
17+
const tracingEvent = envelopeRequestParser(req);
2218

2319
const requestSpans = tracingEvent.spans?.filter(({ op }) => op === 'http.client');
2420

dev-packages/browser-integration-tests/suites/tracing/request/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ Sentry.init({
77
integrations: [Sentry.browserTracingIntegration()],
88
tracePropagationTargets: ['http://example.com'],
99
tracesSampleRate: 1,
10+
autoSessionTracking: false,
1011
});

dev-packages/e2e-tests/test-applications/create-remix-app/tests/client-inp.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ test('sends an INP span after pageload', async ({ page }) => {
8484
'sentry.source': 'custom',
8585
replay_id: expect.any(String),
8686
'user_agent.original': expect.stringContaining('Chrome'),
87+
'client.address': '{{auto}}',
8788
},
8889
description: 'body > div > input#exception-button[type="button"]',
8990
op: 'ui.interaction.click',
@@ -129,6 +130,7 @@ test('sends an INP span during navigation', async ({ page }) => {
129130
'sentry.exclusive_time': expect.any(Number),
130131
replay_id: expect.any(String),
131132
'user_agent.original': expect.stringContaining('Chrome'),
133+
'client.address': '{{auto}}',
132134
},
133135
description: '<unknown>',
134136
op: 'ui.interaction.click',
@@ -183,6 +185,7 @@ test('sends an INP span after navigation', async ({ page }) => {
183185
'sentry.sample_rate': 1,
184186
'sentry.source': 'custom',
185187
'user_agent.original': expect.stringContaining('Chrome'),
188+
'client.address': '{{auto}}',
186189
},
187190
description: '<unknown>',
188191
op: 'ui.interaction.click',

0 commit comments

Comments
 (0)