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

Aberta Para iniciantes
#26,203 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
76/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
javascript, playwright, typescript
Domínio
devtools, testing

Direção de pesquisa

Comece por suites/integrations/thirdPartyErrorsFilter/test.ts, template.html e utils/generatePage.ts para comparar quando os erros first-party e third-party ocorrem. O relatório sugere disparar o erro third-party com um clique em um botão após page.goto e, em seguida, verificar se o teste recebe e marca o evento. Execute o teste Playwright indicado na suíte esm para confirmar o comportamento.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
TypeScript
Estrelas
8.8k
Forks
1.9k
Merge médio
1d 21h
PRs com merge (30d)
637

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de getsentry/sentry-javascript

Todas as issues de getsentry/sentry-javascript

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.