Flaky timing-sensitive sync-service tests: ShapeCacheTest await/startup timeouts under CI load

オープン
#4,712 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
elixir, github-actions, postgresql

調査の方向性

影響を受けるテストケース Electric.ShapeCacheTest、Electric.Plug.TraceContextPlugTest、ShapeLogCollectorTest から始め、5 秒間の await とクリーンアップのタイミングに焦点を当てます。影響を受ける sync-service テストを Postgres マトリクスで実行し、周辺の接続エラーを調査します。テストが意味のある状態を保ち、CI 負荷下でフレークしなくなるか、基盤となる飽和状態が解消されない場合に明確なタグが付けられれば完了です。

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

説明

Summary

A small family of timing-sensitive tests fails intermittently in the sync-service CI workflow — hopping between Postgres matrix versions, passing on rerun with no code change, and burying real signal for PR authors. Two recent PRs (#4711 and its review) each spent effort separating these from genuine failures.

Evidence

Electric.ShapeCacheTest — "await_snapshot_start/4 should wait for consumer to come up"

Electric.ShapeCacheTest — "get_or_create_shape_handle/2 against real db crashes when initial snapshot query fails to return data quickly enough"

Electric.Plug.TraceContextPlugTest — "electric member is found among other tracestate members"

ShapeLogCollectorTest — FlushTracker timing out in Repatch.cleanup

  • Reported during review of #4711 (first CI run of that branch)

Common signature

  • ~5s Task.await timeouts on tests that race consumer/snapshot startup
  • Postgres connection churn in the surrounding logs (tcp connect timeout, econnrefused, tcp recv (idle): closed) suggesting the shared PG instance is briefly saturated by concurrent async tests
  • Not reproducible locally on fast machines; version-hopping across the PG matrix

Suggested directions

  • Widen or parametrize the tight awaits in the affected tests (they're asserting eventual startup, not 5-second startup)
  • Or address the underlying PG saturation (connection pool sizing / readiness in the test env)
  • At minimum, tag the known-flaky set so authors and reviewers can distinguish them from real regressions without re-deriving this analysis

Filed while triaging CI on #4711, where these flakes twice muddied the signal.

主要言語
TypeScript
スター
10.4k
フォーク
399
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

electric-sql/electric のほかの issue

electric-sql/electric の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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