Skip to content

test(config): stop losing notifications during the idle ping - #15

Merged
yordis merged 1 commit into
mainfrom
yordis/test-notifications-idle-ping
Sep 15, 2026
Merged

yordis merged 1 commit into
mainfrom
yordis/test-notifications-idle-ping

Conversation

@yordis

@yordis yordis commented Sep 15, 2026

Copy link
Copy Markdown
Member
  • Postgrex drops a notification that arrives while the notifications connection is running its idle ping, and that is only fixed on Postgrex main (Fix notifications lost during idle ping elixir-ecto/postgrex#795), so no released version protects us
  • A 100ms ping cadence turned that window into a lost append roughly once every 15 runs of the subscription tests, which is why CI failed at random with an empty mailbox and no log output to point at
  • No other test environment sets an idle interval, and neither of the two reconnect tests that motivated it needs one

Postgrex drops a notification that arrives while the notifications
connection is running its idle ping, and that is fixed only on Postgrex
main (elixir-ecto/postgrex#795). A 100ms cadence turned that window into
a failure roughly once every 15 runs of the subscription tests, which is
why CI failed at random with no log output to point at. No other test
environment sets it.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@coderabbitai

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 55a21ae9-73ee-4a42-abf1-e3d8c4ceaa14

📥 Commits

Reviewing files that changed from the base of the PR and between 9d360e3 and 6f00234.

📒 Files selected for processing (1)
  • config/test.exs
💤 Files with no reviewable changes (1)
  • config/test.exs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The test event-store configuration removes the explicit idle_interval value. The configured stores now use the serializer/Connection default idle interval.

Changes

Test event-store configuration

Layer / File(s) Summary
Connection idle interval
config/test.exs
Removed idle_interval: 100 from default_config. Other event-store settings remain unchanged.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 6f002

The test configuration now avoids the frequent idle ping that caused intermittent notification delivery failures. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the test configuration change and its purpose: preventing notification loss during the idle ping. It is concise and specific.
Description check ✅ Passed The description directly explains the Postgrex issue, the intermittent test failures, and why removing the 100 ms idle interval resolves the problem.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yordis/test-notifications-idle-ping

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the store at night
The idle clock now rests just right
No hundred ticks remain
Defaults guide the train
Config hops clean and light

Comment @coderabbitai help to get the list of available commands.

@cursor

cursor Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only configuration change to reduce CI flakiness; no production or runtime behavior change.

Overview
Removes idle_interval: 100 from the shared TestEventStore test config in config/test.exs, so the test pool no longer forces a 100ms Postgrex idle ping.

That ping overlapped with a Postgrex bug where notifications arriving during the idle check can be dropped (fix only on unreleased main), which caused intermittent subscription test failures—empty mailboxes with no useful logs—about once every ~15 runs in CI. Other test stores and reconnect tests did not need this setting.

Reviewed by Cursor Bugbot for commit 6f00234. Bugbot is set up for automated code reviews on this repo. Configure here.

@yordis
yordis merged commit 7f2f801 into main Sep 15, 2026
8 checks passed
@yordis
yordis deleted the yordis/test-notifications-idle-ping branch September 15, 2026 15:38
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.

1 participant