🤖 tests: backgroundProcessesRepro reads exit_code before the trap writes it (CI flake)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- shell, typescript
- 領域
- testing
調査の方向性
src/node/services/backgroundProcessesRepro.test.ts の 107 行目付近にある spawnExited ヘルパーから始めてください。このヘルパーは終了コードのファイルを待ち、その後一度だけ読み込みます。マーカーを書き込む EXIT トラップは src/node/runtime/backgroundCommands.ts の 83 行目付近にあります。同じテストファイルの 386 行目と 478 行目付近にある、同様の待機してから読み込む処理も確認してください。ファイルに数値が含まれるまでヘルパーが解決せず、負荷の下でもテストが繰り返し成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem
backgroundProcessesRepro.test.ts failed once in CI and passed on the rerun. The failing test is "terminating a background process that already exited > a stop after a natural exit sends no signal to the process group" (2013 ms).
- Run: https://github.com/coder/xum/actions/runs/38532297270 (attempt 1, job "Test / Unit (1/6)", PR #6475). Attempt 2 passed.
expectReproFailurereported "repro failed elsewhere". The real error came from the setup helperspawnExited, not from the target assertion:
at spawnExited (src/node/services/backgroundProcessesRepro.test.ts:108:63)
expect(received).toBe(expected)
Expected: "3"
Received: ""
Cause (from reading the code, not reproduced yet)
- The wrapper's EXIT trap writes the marker with
echo $? > "$__MUX_EXIT_CODE_PATH"(src/node/runtime/backgroundCommands.ts:83). The shell creates the file first and writes the digits after that. For a short time the file exists and is empty. spawnExitedwaits only until the file exists (backgroundProcessesRepro.test.ts:107), then reads it once (line 108). A read in that gap returns "".- The product reader already treats an empty marker as "no exit code yet" (
getExitCodeStrict,src/node/services/backgroundProcessExecutor.ts:654-659). So I think only the test helper is wrong. I did not verify every other reader.
This is not the same cause as #6443 (that one is slow happy-dom matcher output inside waitFor).
Possible fix
Make the helper wait until the file holds a number (for example waitFor(async () => /^\d+$/.test((await fs.readFile(f, "utf-8").catch(() => "")).trim()))), and check other tests that use the same "exists, then read" shape on exit_code (lines 386 and 478 of the same file wait on files too).
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $1.26
- 主要言語
- TypeScript
- スター
- 2.1k
- フォーク
- 140
- 平均マージ
- 4時間 55分
- マージ済み PR(30日)
- 900
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/xum のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
🤖 fix: stream-error card header actions reach 2.6px into the card padding in a 170px VS Code sidebarオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
tech-debt
難易度 2/5 半日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
approved backlog
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
zts212653/clowder-ai#1678 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
Progressive-Victory/the-website#680 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100