Skip to content

Commit

Permalink
test(ci): Fix failing tests (#11554)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mydea authored Apr 11, 2024
1 parent 9d0472b commit 5a60afd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ sentryTest('should start a new session with navigation.', async ({ getLocalTestP
const url = await getLocalTestPath({ testDir: __dirname });
await page.route('**/foo', (route: Route) => route.fulfill({ path: `${__dirname}/dist/index.html` }));

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const initSession = await getFirstSentryEnvelopeRequest<SessionContext>(page, url);

await page.click('#navigate');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ sentryTest('should start a new session with navigation.', async ({ getLocalTestP
const url = await getLocalTestPath({ testDir: __dirname });
await page.route('**/foo', (route: Route) => route.fulfill({ path: `${__dirname}/dist/index.html` }));

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const initSession = await getFirstSentryEnvelopeRequest<SessionContext>(page, url);

await page.locator('#navigate').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ sentryTest('should start a new session with navigation.', async ({ getLocalTestP
const url = await getLocalTestPath({ testDir: __dirname });
await page.route('**/foo', (route: Route) => route.fulfill({ path: `${__dirname}/dist/index.html` }));

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const initSession = await getFirstSentryEnvelopeRequest<SessionContext>(page, url);

await page.locator('#navigate').click();
Expand Down

0 comments on commit 5a60afd

Please sign in to comment.