Task editor scroll-sync test fails intermittently in CI

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

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

@melonpuff đang làm issue này rồi.

Từ ngày 12/11/2026.

Đá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
78/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
Lĩnh vực
testing

Hướng nghiên cứu

Đọc assertion cuộn cuối cùng trong tests/browser/task-workspace.test.js quanh dòng 599 và điều kiện chờ phía trước. Issue chỉ ra khả năng xảy ra race condition: điều kiện chờ kiểm tra xem lớp tô sáng đã cuộn hay chưa; điều này có thể đã đúng trước khi lớp đó đến vị trí mới của vùng văn bản. Cập nhật điều kiện đồng bộ để assertion chờ đến khi cả ba vị trí cuộn khớp nhau, sau đó chạy kiểm thử trình duyệt và xác nhận các vị trí khớp nhau.

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

Mô tả

Observed behavior

The browser test "the task editor paints syntax colours and line numbers behind the textarea" (tests/browser/task-workspace.test.js, the final scroll assertion) failed once in CI on a change that does not touch web/. The three scroll positions it compares were [900, 2276, 2276]: the textarea at the 900 the test had just set, the highlight layer and the line-number gutter at 2276. The same job passed on a rerun, and the identical tree had passed in the previous run of the pull request, so the failure depends on timing and not on the code under test.

Expected behavior

The test passes whenever the layers do follow the textarea, and fails only when they do not. A passing run and a failing run of the same tree should not differ.

Reproduction

I have not reproduced it locally, so this is a single observation, not a measured rate.

  1. Run the three-shard browser lane (gates (browser 2/3)) on GitHub Actions for a pull request whose diff does not touch web/.
  2. The test fails when the highlight layer and gutter have not yet followed the textarea to the position the test set (scrollTop = 900).

What I saw: run 42952178222, job 130298787099, head 5736b690e196636785aa06bd3844b4e581d3fae6, one failure, then a pass on rerun of the failed job. How often it happens elsewhere is unknown.

CodeTrial version

Not a runtime report. The failing revision is 5736b690e196636785aa06bd3844b4e581d3fae6 (a pull request that changes skill scripts and their Python tests only).

Environment

  • GitHub Actions, ubuntu runner, gates (browser 2/3) shard of the browser lane
  • Chromium through Playwright, headless

Hypothesis (not confirmed)

After page.fill of the 120-line buffer the caret sits at the end, so the textarea is already scrolled to the bottom and the layers follow it there (2276 here). The test then sets scrollTop = 900 and waits with waitForFunction until the highlight layer's scrollTop > 0. That condition can already be true from the earlier scroll position, so the wait can return before the layers have followed to 900, and the assertion reads the stale 2276 from the layers. Waiting for the layers' scrollTop to equal the textarea's, instead of > 0, would remove the race; I have not tried it.

Sanitized evidence

AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
  actual:   [ 900, 2276, 2276 ]
  expected: [ 900, 900, 900 ]
  at tests/browser/task-workspace.test.js:599:12
failed gates: browser-tests
Ngôn ngữ chính
Rust
Star
228
Fork
150
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
226

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 sysprog21/codetrial

Tất cả issue của sysprog21/codetrial

Issue tương tự

Thêm issue về Rust

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.