test(eventstore): silence expected disconnect chatter - #102
Conversation
yordis
commented
Apr 29, 2026
- keep adapter-backed test runs from drowning in expected connection teardown noise
- scope the logger suppression to the DBConnection path that emits informational disconnect messages while preserving warnings and errors
- make the full adapter-inclusive suite easier to trust by leaving only unexpected failures visible
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
PR SummaryCursor Bugbot is generating a summary for commit 69be472. Configure here. |
WalkthroughA new test helper module is introduced to suppress module-level logging for Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/support/module_logger_level_helpers.ex (1)
8-17: Consider adding a dedicated DBConnection helper to remove repeated literals.
DBConnection.Connection+:warningis repeated across multiple test modules. A wrapper here would centralize intent and reduce drift risk.♻️ Proposed refactor
defmodule Commanded.TestSupport.ModuleLoggerLevelHelpers do @@ def suppress_module_log_level(module, level) do @@ end + + def suppress_dbconnection_disconnect_logs do + suppress_module_log_level(DBConnection.Connection, :warning) + end🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/support/module_logger_level_helpers.ex` around lines 8 - 17, Extract the repeated literal pair DBConnection.Connection and :warning into a dedicated helper (e.g., suppress_dbconnection_warning or suppress_db_conn_warning) that delegates to suppress_module_log_level(module, level) by calling suppress_module_log_level(DBConnection.Connection, :warning); add this new function near suppress_module_log_level in test/support/module_logger_level_helpers.ex and update all test modules that currently call suppress_module_log_level(DBConnection.Connection, :warning) to call the new helper instead to centralize intent and reduce duplication.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@test/support/module_logger_level_helpers.ex`:
- Around line 8-17: Extract the repeated literal pair DBConnection.Connection
and :warning into a dedicated helper (e.g., suppress_dbconnection_warning or
suppress_db_conn_warning) that delegates to suppress_module_log_level(module,
level) by calling suppress_module_log_level(DBConnection.Connection, :warning);
add this new function near suppress_module_log_level in
test/support/module_logger_level_helpers.ex and update all test modules that
currently call suppress_module_log_level(DBConnection.Connection, :warning) to
call the new helper instead to centralize intent and reduce duplication.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bbef0f5f-5c49-4fd7-8508-adb0cf78fbfe
📒 Files selected for processing (6)
test/aggregates/snapshotting_postgres_test.exstest/event_store/adapters/event_store/event_store_prefix_test.exstest/event_store/adapters/event_store/event_store_test.exstest/opentelemetry/application_e2e_test.exstest/support/event_store_test_case.extest/support/module_logger_level_helpers.ex