Skip to content

test(e2e/sveltekit): Unflake client error test by waiting for hydration #11469

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
Apr 8, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Apr 8, 2024

Both SvelteKit e2e test apps have a flaky test that checks for a client-side error to be caught by the SDK. Looks like Kit hydration takes too long in the Playwright env to kick in, leading to our test clicking the error-triggering button before the onclick handler code is registered.

The PR attempts to fix the the flakiness by awaiting the initial pageload, meaning we await

  • going to the specified route
  • a custom hydration flag being set
  • the pageload transaction being sent

This will prolong the test for a couple of ms but I think that's acceptable.

@Lms24 Lms24 requested a review from lforst April 8, 2024 08:57
@Lms24 Lms24 merged commit 6eddfc9 into develop Apr 8, 2024
@Lms24 Lms24 deleted the lms/test-e2e-sveltekit-waitForInitialPageload branch April 8, 2024 09:07
cadesalaberry pushed a commit to cadesalaberry/sentry-javascript that referenced this pull request Apr 19, 2024
…on (getsentry#11469)

Attempt to fix the Kit test flakiness by awaiting the initial
pageload and hydration, meaning we await
- going to the specified route
- a custom hydration flag being set
- the pageload transaction being sent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants