Task editor scroll-sync test fails intermittently in CI

オープン 初心者向け
#654 コメント 2 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@melonpuff がすでに取り組んでいます。

2026年11月12日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, playwright
領域
testing

調査の方向性

tests/browser/task-workspace.test.js の599行目付近にある最後のスクロールに関するアサーションと、その直前の待機条件を確認してください。Issueでは、競合状態の可能性が指摘されています。待機条件はハイライトレイヤーがスクロールしたかどうかを確認していますが、テキストエリアの新しい位置に到達する前に、すでに真になっている可能性があります。アサーションが3つすべてのスクロール位置が一致するまで待つように、同期条件を更新してください。その後、ブラウザテストを実行し、位置が一致することを確認してください。

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
Rust
スター
228
フォーク
150
平均マージ
1日 3時間
マージ済み PR(30日)
226

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sysprog21/codetrial のほかの issue

sysprog21/codetrial の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。