Skip to content

fix: electron e2e の launch fixture teardown timeout を 60s に拡大する#247

Merged
ymnao merged 2 commits into
mainfrom
fix/electron-launch-fixture-timeout-#246
Jun 27, 2026
Merged

fix: electron e2e の launch fixture teardown timeout を 60s に拡大する#247
ymnao merged 2 commits into
mainfrom
fix/electron-launch-fixture-timeout-#246

Conversation

@ymnao

@ymnao ymnao commented Jun 27, 2026

Copy link
Copy Markdown
Owner

概要

PR #245 の初回 CI で flaky fail した e2e/electron/structured-error.electron.spec.ts:24:6Tearing down "launch" exceeded the test timeout of 30000ms. を救済する。launch fixture に { timeout: 60_000 } を明示し、teardown 単独で 60s の余裕を持たせる (test 本体の timeout は default 30s のまま据え置き)。

関連 Issue

Closes #246

移行 Stage

該当なし (e2e test infra の hardening、強いて言えば Stage 6: 仕上げ枠)。

変更内容

  • e2e/electron/helpers/launch.tslaunch fixture を Playwright の配列形式 [fn, options] に書き換え、{ timeout: 60_000 } を明示
  • diff: 1 file / +20 -12 (うち実質変更は配列化と timeout option の 1〜2 行、残りは説明コメント 5 行 + indent 移動)
  • 通常 app.close() は 1〜2s で完了するので副作用は実質なし、稀に xvfb 上で 30s 超となるケース (本回 flaky) を救済

採用案 (Option A) と見送り根拠

Issue #246 で挙げた 5 候補のうち Option A を採用:

Option 内容 採用 / 見送り
A launch fixture に { timeout: 60_000 } 明示 採用 (scope 最小、low risk、副作用ほぼなし)
B spec 側で afterEach 明示 close + try/catch 見送り (launch fixture で集約管理しているので個別 spec での処理は二重管理になる)
C _electron.launchargs に flag 追加 見送り (root cause 不明な段階の workaround、実機挙動と乖離する)
D playwright.electron.config.tsretries を 1 → 2 見送り (既存 retries: 1 で救済できなかったので effect 弱い)
E app.close()Promise.race + force-kill 見送り (Option A で解決しない場合の次の手として保留)

再発時の段階的エスカレーション (記録)

Option A で flaky が再発した場合の次の手:

  1. Option D (retries: 1 → 2) で救済
  2. Option E (app.close() への Promise.race + force-kill) で hang を hard cut
  3. CI artifact (error-context.md / trace.zip) を retain して具体 stack を観測 → root cause 調査

動作確認

  • pnpm typecheck pass (renderer / main / preload)
  • pnpm typecheck:e2e pass (Playwright 配列形式 fixture の型 OK)
  • pnpm lint (biome) pass、本 file の既存 noEmptyPattern override に影響なし
  • pnpm test (unit) 2230 件 pass + 2 件 skip
  • pnpm test:e2e:electron ローカル sandbox EPERM で動かない (HANDOFF 既知) → CI の electron-e2e job が pass することで検証する
  • CI 上で他 9 spec (launch fixture を共有) への影響なしを確認

スクリーンショット

該当なし (test infra の変更)

ymnao added 2 commits June 27, 2026 13:24
PR #245 の初回 CI で flaky fail した `structured-error.electron.spec.ts`
の `Tearing down "launch" exceeded the test timeout of 30000ms.` を救済する。

`launch` fixture は明示的な timeout を持たなかったため test timeout
(default 30s) と共有していた。`{ timeout: 60_000 }` を Playwright の
配列形式で明示し、teardown 単独に 60s の余裕を持たせる (test 本体の
timeout は default 30s のまま据え置きで、本体 hang の検出は従来通り維持)。

Closes #246
/simplify レビューを適用:

- 5 行コメントを 2 行に圧縮 (Playwright 仕様解説は公式 doc 任せ)
- teardown の sequential `for...of + await app.close()` を
  `Promise.all` 化。再 launch test で teardown が直列で線形に
  伸びるのを抑制し、今回の timeout 拡張動機 (teardown 余裕確保)
  と整合
@ymnao ymnao merged commit a15646c into main Jun 27, 2026
9 checks passed
@ymnao ymnao deleted the fix/electron-launch-fixture-timeout-#246 branch June 27, 2026 04:48
@ymnao ymnao mentioned this pull request Jul 5, 2026
7 tasks
ymnao added a commit that referenced this pull request Jul 5, 2026
- package.json の version を 0.6.0 → 0.7.0 に bump
- CHANGELOG.md に v0.7.0 エントリを追加 (#243#280)
  - Fixed: FileTree scroll regression (#276)、electron e2e launch teardown timeout 拡大 (#247)
  - Internal: #209 3 項目 (drift-lock 系 refactor #278/#279/#280)、settings setter 集約 (#273#277)、search/workspace/backlink 系 helper 抽出 15 件
  - Dependencies: electron 43.0.0 / p-limit 7.3.0 major bump (#275)、Dependabot 7 件 combine (#274)、pnpm-workspace.yaml overrides で @codemirror dual copy を恒久防止

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: electron e2e の launch fixture teardown timeout を 60s に拡大する

1 participant