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

Đang mở Phù hợp với người mới
#26,203 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, playwright, typescript
Lĩnh vực
devtools, testing

Hướng nghiên cứu

Bắt đầu với suites/integrations/thirdPartyErrorsFilter/test.ts, template.html và utils/generatePage.ts để so sánh thời điểm xảy ra lỗi first-party và third-party. Báo cáo đề xuất kích hoạt lỗi third-party bằng cách nhấp vào nút sau page.goto, rồi kiểm tra xem bài kiểm thử có nhận và gắn thẻ cho sự kiện hay không. Chạy bài kiểm thử Playwright được nêu tên trong bộ esm để xác nhận hành vi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
8.8k
Fork
1.9k
Merge trung bình
1 ngày 21 giờ
Pull request đã merge (30 ngày)
637

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của getsentry/sentry-javascript

Tất cả issue của getsentry/sentry-javascript

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.