Flaky timing-sensitive sync-service tests: ShapeCacheTest await/startup timeouts under CI load
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start with the affected Electric.ShapeCacheTest, Electric.Plug.TraceContextPlugTest, and ShapeLogCollectorTest cases, focusing on their 5-second awaits and cleanup timing. Run the affected sync-service tests under the Postgres matrix and inspect the surrounding connection errors. Done means the tests remain meaningful, no longer flake under CI load, or are clearly tagged if the underlying saturation is not addressed.
Written by the indexing model from the issue text.
Description
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"
- Failed on pg15: https://github.com/electric-sql/electric/actions/runs/29346393580/job/87131112285 —
Task.await(..., 5300)timeout - Passed on rerun of the same commit (all matrices green)
- Failed on pg17 two commits later: https://github.com/electric-sql/electric/actions/runs/29348549229/job/87138530389 — same test, same timeout
- The failing branch's changes don't execute in this test (verified: the changed code is HTTP-serve-path only, and the branch's heavy
async: falseintegration tests run after the async phase this test runs in — no load coupling)
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.awaittimeouts 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.
- Dominant language
- TypeScript
- Stars
- 10.4k
- Forks
- 399
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from electric-sql/electric
-
camelToSnake and snakeCamelMapper() drop the underscore when a digit precedes a camelCase boundaryOpen
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
electric-sql/electric#4855 ·
-
ShapeStream does not notify subscribers when it gives up on a non-Error valuePossibly taken @Tyagiquamar claimed this 19 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
electric-sql/electric#4830 ·
-
@electric-sql/client throws SecurityError on import when the browser blocks site storage (typeof localStorage outside try)Possibly taken @mohanedmoh claimed this 37 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
electric-sql/electric#4826 · 1 comment ·
-
agents-chat-starter: spawn PUT goes to the durable-streams proxy, so no entity is created and agents never wakePossibly taken @adityavkk claimed this 133 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
electric-sql/electric#4687 ·
-
Listen IP addressOpenfeature request triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
electric-sql/electric#4150 · 1 comment ·
All issues in electric-sql/electric
Similar issues
-
area:cli area:security bug priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
"code source" and "numerique.gouv" links: "new window" mention duplicated in the accessible nameOpenaccessibility
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
numerique-gouv/lasuite-landingpage#315 ·
Maintainers usually reply within 1 day
-
needs:triage
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
HyeokjaeChoi/vaultme#585 ·
Maintainers usually reply within 1 day
-
enhancement priority/P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
beettlle/pi-smart-router#200 ·