You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "yyqdbngt (via GitHub)" <gi...@apache.org> on 2026/09/05 03:09:43 UTC

[PR] test(alert): cover NativeAlertEvaluationService evaluation orchestration [rocketmq-dashboard]

yyqdbngt opened a new pull request, #3253:
URL: https://github.com/apache/rocketmq-dashboard/pull/3253

   ## Summary
   
   Adds `NativeAlertEvaluationServiceTest`, pure unit coverage (no Spring context) for the per-evaluation transaction that aggregates a native sample, advances alert state, persists the lifecycle event, and enqueues notifications. All collaborators are mocked.
   
   Coverage:
   - a non-matching rule returns without touching state, snapshot, alert, outbox, or suppression collaborators;
   - window aggregation per rule: `MAX`/`MIN`/`AVG`/`SUM`/`LAST` (case-insensitive, null → `LAST`) applied to the snapshot window fetched since `collectedAt - windowSeconds`, while unavailable samples and windowless rules skip the lookup entirely;
   - a firing evaluation persists an event with the severity→level mapping (`critical`→error, `warning`→warning, anything else→info), the correct description/fingerprint/transition/instance fields, marks the rule triggered, and enqueues the notification;
   - a BUSINESS firing/reminder alert is suppressed (with cause id and reason) while a cluster incident is active, and the outbox is skipped;
   - CLUSTER-domain alerts are never suppression-checked;
   - non-emitting transitions (e.g. `PENDING`) persist the state but skip event persistence and enqueue.
   
   ## Why
   
   The service decides whether a native sample becomes an alert event and which notifications are enqueued; existing coverage only exercises transaction rollback semantics via `@SpringBootTest`, not these branches.
   
   ## Testing
   
   `mvn -B test -Dtest=NativeAlertEvaluationServiceTest` — 8/8 pass; checkstyle (validate) clean.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] test(alert): cover NativeAlertEvaluationService evaluation orchestration [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #3253: test(alert): cover NativeAlertEvaluationService evaluation orchestration
URL: https://github.com/apache/rocketmq-dashboard/pull/3253


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org