Skip to content

test(event): quiet expected handler retry logs - #101

Merged
yordis merged 2 commits into
mainfrom
yordis/test-capture-expected-handler-logs
Apr 29, 2026
Merged

yordis merged 2 commits into
mainfrom
yordis/test-capture-expected-handler-logs

Conversation

@yordis

@yordis yordis commented Apr 29, 2026 •

Copy link
Copy Markdown
Member
  • keep expected event-handler retry behavior from flooding the full test suite output with noise
  • make the delayed backoff path inherit test-owned setup so log suppression stays scoped to the scenario that intentionally exercises failure handling
  • improve suite signal by leaving only unexpected failures visible during broad test runs

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

cursor Bot commented Apr 29, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only changes that adjust setup/teardown and logging to reduce expected noise; minimal risk beyond potential test flakiness if logger state restoration is incorrect.

Overview
Updates event_handler_error_handling_test.exs to stop auto-starting SimpleErrorEventHandler via setup, and instead starts it explicitly inside the three "Configured error handling" tests via a renamed helper (start_simple_error_handler!/0) that now returns a map.

The :backoff test now temporarily raises the Commanded.Event.Handler logger level (and restores it on exit) to prevent expected retry/backoff logs from flooding the test suite output while still asserting telemetry timing.

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

@coderabbitai

coderabbitai Bot commented Apr 29, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f0686fa1-f556-43c7-a235-a51c3434f043

📥 Commits

Reviewing files that changed from the base of the PR and between 3e7eba5 and 24b4d4f.

📒 Files selected for processing (1)
  • test/event/event_handler_error_handling_test.exs

Walkthrough

The test file refactors error handling tests to remove a shared setup callback in favor of explicit handler initialization via a new start_simple_error_handler!/0 helper function. The helper's return type changes from a keyword list to a map containing :handler and :ref keys. Logger module log level management is added for isolated test execution.

Changes

Cohort / File(s) Summary
Test Setup Refactoring
test/event/event_handler_error_handling_test.exs
Refactored "Configured error handling" tests to replace shared setup callback with explicit start_simple_error_handler!/0 helper invocations; helper now returns a map with :handler and :ref keys. Added Logger module log level capture/restore for :backoff test isolation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A helper hops into view, so bright,
Handlers start with explicit delight,
Log levels captured, restored with care,
Tests now isolated everywhere! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: suppressing expected handler retry logs in tests. It directly matches the primary objective of quieting test output noise.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for quieting handler retry logs, scoping suppression to specific scenarios, and improving test signal.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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-capture-expected-handler-logs

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 10089f2. Configure here.

Comment thread test/event/event_handler_error_handling_test.exs
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis merged commit 2f63bfa into main Apr 29, 2026
3 checks passed
@yordis
yordis deleted the yordis/test-capture-expected-handler-logs branch April 29, 2026 06:48
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