Skip to content

chore(e2e): Reduce solid e2e tests flakines by waiting for more speci… #12455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { waitForError } from '@sentry-internal/test-utils';

test('captures an exception', async ({ page }) => {
const errorEventPromise = waitForError('solid', errorEvent => {
return !errorEvent.type;
return !errorEvent.type && errorEvent.transaction === '/error-boundary-example';
Copy link
Contributor

@lforst lforst Jun 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally you find a very specific way to wait for events, as they may leak between tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any ideas? I can only think of creating a different route per test.

Copy link
Member

@Lms24 Lms24 Jun 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

different route per test

I think this is what we usually do 😬 another option would be to configure playwright to only sequentially run tests but it's also not ideal...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The leaking I had happened between the errorboundary tests and the normal error tests, and there the transaction field is different. Maybe we can leave it as is for now and see if there's more flakiness to fix later?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also set tags or contexts in the tests and assert on them!

});

const [, errorEvent] = await Promise.all([page.goto('/error-boundary-example'), errorEventPromise]);
Expand All @@ -27,7 +27,7 @@ test('captures an exception', async ({ page }) => {

test('captures a second exception after resetting the boundary', async ({ page }) => {
const firstErrorEventPromise = waitForError('solid', errorEvent => {
return !errorEvent.type;
return !errorEvent.type && errorEvent.transaction === '/error-boundary-example';
});

const [, firstErrorEvent] = await Promise.all([page.goto('/error-boundary-example'), firstErrorEventPromise]);
Expand All @@ -49,7 +49,7 @@ test('captures a second exception after resetting the boundary', async ({ page }
});

const secondErrorEventPromise = waitForError('solid', errorEvent => {
return !errorEvent.type;
return !errorEvent.type && errorEvent.transaction === '/error-boundary-example';
});

const [, secondErrorEvent] = await Promise.all([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { waitForError } from '@sentry-internal/test-utils';

test('sends an error', async ({ page }) => {
const errorPromise = waitForError('solid', async errorEvent => {
return !errorEvent.type;
return !errorEvent.type && errorEvent.transaction === '/';
});

await Promise.all([page.goto(`/`), page.locator('#errorBtn').click()]);
Expand Down
Loading