Skip to content

Commit 5a60afd

Browse files
authored
test(ci): Fix failing tests (#11554)
This hopefully fixes these tests that randomly started failing 😬 debugging this on CI, I saw that the second session envelope it sent was about discarding session events because sending them failed. So ensuring we don't drop the sessions should fix this, I think.
1 parent 9d0472b commit 5a60afd

File tree

3 files changed

+24
-0
lines changed
  • dev-packages/browser-integration-tests/suites/sessions

3 files changed

+24
-0
lines changed

dev-packages/browser-integration-tests/suites/sessions/initial-scope/test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ sentryTest('should start a new session with navigation.', async ({ getLocalTestP
2525
const url = await getLocalTestPath({ testDir: __dirname });
2626
await page.route('**/foo', (route: Route) => route.fulfill({ path: `${__dirname}/dist/index.html` }));
2727

28+
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
29+
return route.fulfill({
30+
status: 200,
31+
contentType: 'application/json',
32+
body: JSON.stringify({ id: 'test-id' }),
33+
});
34+
});
35+
2836
const initSession = await getFirstSentryEnvelopeRequest<SessionContext>(page, url);
2937

3038
await page.click('#navigate');

dev-packages/browser-integration-tests/suites/sessions/start-session/test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ sentryTest('should start a new session with navigation.', async ({ getLocalTestP
2424
const url = await getLocalTestPath({ testDir: __dirname });
2525
await page.route('**/foo', (route: Route) => route.fulfill({ path: `${__dirname}/dist/index.html` }));
2626

27+
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
28+
return route.fulfill({
29+
status: 200,
30+
contentType: 'application/json',
31+
body: JSON.stringify({ id: 'test-id' }),
32+
});
33+
});
34+
2735
const initSession = await getFirstSentryEnvelopeRequest<SessionContext>(page, url);
2836

2937
await page.locator('#navigate').click();

dev-packages/browser-integration-tests/suites/sessions/v7-hub-start-session/test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ sentryTest('should start a new session with navigation.', async ({ getLocalTestP
2424
const url = await getLocalTestPath({ testDir: __dirname });
2525
await page.route('**/foo', (route: Route) => route.fulfill({ path: `${__dirname}/dist/index.html` }));
2626

27+
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
28+
return route.fulfill({
29+
status: 200,
30+
contentType: 'application/json',
31+
body: JSON.stringify({ id: 'test-id' }),
32+
});
33+
});
34+
2735
const initSession = await getFirstSentryEnvelopeRequest<SessionContext>(page, url);
2836

2937
await page.locator('#navigate').click();

0 commit comments

Comments
 (0)