Flaky test: query-sql-streaming terminal memory guard misses the expected budget error

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

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

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

2026年11月16日 から。

  • #3006 @platypii による — オープン

評価

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

調査の方向性

test/core/query-sql-streaming.test.jsの107行目付近から始めて、#2969で追加された終端のメモリガードテストを読んでください。テストがヒープ測定値をどのように取得し、終端のチェックがそれをどのように使うかを確認してください。issueでは、決定論的な測定値を注入する方法が提案されています。完了条件は、実際のヒープ読み取りに依存せず、テストがQueryExecutionBudgetErrorを確実にアサートすることです。

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

説明

What happens

test/core/query-sql-streaming.test.js:107, "the terminal memory guard covers retained consumer output on early break", failed once in a merge-group run and removed an unrelated PR from the merge queue.

AssertionError [ERR_ASSERTION]: Missing expected rejection (QueryExecutionBudgetError).
    at async TestContext.<anonymous> (test/core/query-sql-streaming.test.js:110:3)

Sighting

  • Run 43942627137 (merge group for #2998 on master b2ffe17d), job test (24) 133563858691, 2026-11-16T19:48:15Z. The test took 119 ms.
  • test (26) passed in the same run. test (22) was cancelled when test (24) failed.
  • The same tree passed test (22), test (24) and test (26) minutes earlier on the PR itself (#2998 at 2b24b55c, which already contains master b2ffe17d).
  • #2998 changes the ai-gateway proxy, the test runner script and three other tests. It does not touch query streaming.

Why it looks like a race in the test, not in the PR

The test streams with maxHeapBytes: 1, breaks out of the loop after the first batch while holding 50,000 retained rows, and expects the terminal memory check to reject with QueryExecutionBudgetError. Whether it rejects depends on what the heap measurement reads at that moment. On this run it read under the limit, so nothing was thrown. The test was added in #2969.

Not verified: the exact reading that made the guard pass. Nobody has reproduced it locally.

Effect

A PR that does not touch this code can be dropped from the merge queue and has to be enqueued again.

What a fix needs

Make the test independent of the live heap reading (for example by injecting the measurement), or make the terminal check's reading deterministic for the test. The guard's product behavior is not in question here.

主要言語
JavaScript
スター
11
フォーク
0
平均マージ
1時間 14分
マージ済み PR(30日)
262

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

hyparam/hypaware のほかの issue

hyparam/hypaware の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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