unbridled-41 commented on PR #4748:
URL: 
https://github.com/apache/rocketmq-dashboard/pull/4748#issuecomment-5759914657

   ### Evidence added in the second commit (`7bc88253`)
   
   The first commit's test asserted the state transition; the description also 
claims the *recovery half* — "no `RESOLVED` event, no recovery notification" 
without the fix. The case now asserts all three: the pass does not throw, the 
surviving rule is resolved, the `RESOLVED` lifecycle event is recorded 
(`alerts.saveAlert`, transition `RESOLVED`) and the notification is queued 
(`outbox.enqueue(event, rule, labels)`).
   
   **Teeth beyond the original crash** — a plausible wrong fix was used as the 
contrast, since a "bail out of the pass when the domain has a metric-less rule" 
implementation would have satisfied the first commit's assertions. Only 
`NativeAlertProcessor.java` was mutated (an early `return` in 
`reconcileMissingActiveStates`); the test file was untouched:
   
   ```
   $ cd server && mvn -B -ntp -o test 
-Dtest=NativeAlertProcessorTest#reconcilesRemainingRulesWhenAnotherRuleHasNoMetricTest
   [ERROR] ...reconcilesRemainingRulesWhenAnotherRuleHasNoMetricTest <<< 
FAILURE!
   Wanted but not invoked:                        # states.save / 
alerts.saveAlert / outbox.enqueue
   [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0        # BUILD 
FAILURE
   ```
   
   Restored immediately afterwards (`git diff --stat` = the test file only), 
then:
   
   ```
   $ mvn -B -ntp -o test -Dtest=NativeAlertProcessorTest
   [INFO] Tests run: 24, Failures: 0, Errors: 0, Skipped: 0        # BUILD 
SUCCESS
   
   $ mvn -B -ntp -o test 
-Dtest='org.apache.rocketmq.studio.ops.alert.**,CollectorSchedulerTest'
   [ERROR] Tests run: 318, Failures: 0, Errors: 5, Skipped: 0
   ```
   
   Same 318/0/5 as before this commit; the 5 errors are the sandbox's missing 
MySQL (`NativeAlertEvaluationTransactionTest`, 
`NotificationOutboxMapperIntegrationTest`, 
`RmqAlertStateMapperIntegrationTest`), unchanged from the clean-trunk baseline.
   
   **State of this PR**
   
   - head `7bc88253`, 2 commits (`092a9e3d` fix + `7bc88253` test), base 
`rocketmq-studio`, MERGEABLE/CLEAN, not merged.
   - numstat: 
`server/src/main/java/org/apache/rocketmq/studio/ops/alert/NativeAlertProcessor.java
 +12/-1`, `NativeAlertProcessorTest.java +46/-4`.
   - No claim in the description is left uncovered: the abort, the surviving 
rule's state, its event and its notification are all asserted.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to