[Flaky CI]: Playwright esm Tests - thirdPartyErrorsFilter third-party error can fire before Sentry.init

Ouverte Adaptée aux débutants
#26,203 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
76/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
javascript, playwright, typescript
Domaine
devtools, testing

Piste de recherche

Commencez par suites/integrations/thirdPartyErrorsFilter/test.ts, template.html et utils/generatePage.ts pour comparer le moment où les erreurs de première partie et de tiers se produisent. Le rapport suggère de déclencher l’erreur de tiers en cliquant sur un bouton après page.goto, puis de vérifier que le test reçoit et étiquette l’événement. Exécutez le test Playwright nommé dans la suite esm pour confirmer le comportement.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Waiting for: Product Owner
Flakiness Type

Timeout

Name of Job

CI: Build & Test / Playwright esm (1/4) Tests

Name of Test

suites/integrations/thirdPartyErrorsFilter/test.ts › tags event if contains at least one third-party frame (chromium)

Link to Test Run

https://github.com/getsentry/sentry-javascript/actions/runs/42369835136/job/128396391992

Details

Failed 3 times on develop between Nov 5 and Nov 7 (run, run, run), always page.waitForRequest: Test timeout of 30000ms exceeded. The other test in the file hasn't failed.

I think it's a script-ordering race. template.html loads thirdPartyScript.js as a blocking script, which throws from a setTimeout(..., 100). The init bundle is injected with scriptLoading: 'defer' (utils/generatePage.ts), so it only runs after parsing. If the deferred init takes longer than 100 ms on a slow runner, the error fires before Sentry.init has installed the global handler, and no event is ever sent. The first-party test avoids this because its error comes from page.click after page.goto.

I haven't reproduced it locally. Suggested fix: have thirdPartyScript.js throw from a click handler on its own button, and click it in the test after page.goto, mirroring the first-party test. The error still only has a frame from the third-party script, so the assertion means the same thing. Happy to open a PR if that sounds right.

Langage dominant
TypeScript
Étoiles
8.8k
Forks
1.9k
Merge moyen
1 j 21 h
PR mergées (30 j)
637

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de getsentry/sentry-javascript

Toutes les issues de getsentry/sentry-javascript

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.