Aias00 opened a new pull request, #7201: URL: https://github.com/apache/rocketmq-dashboard/pull/7201
### Which Issue(s) This PR Fixes Fixes #7198. ### Brief Description A windowed rule test collects a fresh observation without saving it, then aggregates only the stored snapshot rows. Once history exists, the observation that triggered the test is discarded: a stored lag of 10 and a newly collected lag of 100 produce LAST=10 and AVG=10 instead of LAST=100 and AVG=55. Add a separate aggregation entry point for unpersisted observations. Rule tests append the fresh observation to a copy of the historical window; scheduled evaluation continues using the already-persisted window. Preserve the read-only rule-test contract, unavailable-sample behavior, and disabled-window fallback. Correct the existing mocks that incorrectly placed the test observation in stored history. Add a real-repository H2 regression across LAST, AVG, SUM, MAX, and MIN, asserting both the result and that only the historical row remains stored. Document the observation lifecycle. This is a follow-up to #6875 / merged #6876: it retains the window aggregation added there and fixes the omission of the fresh observation. It does not address the future-bound hardening in #5152. ### How Did You Test This Change? JDK 21.0.12.1 and Maven 3.10.0: - Before the implementation, `mvn -f server/pom.xml -o -B -ntp -Dtest=NativeAlertRuleFreshSampleIntegrationTest test`: 5 tests, 4 assertion failures, 0 errors. LAST, AVG, SUM, and MAX all report 10. - Focused rule-test, real snapshot repository integration, and native processor tests: 55 passed, including existing scheduled SUM aggregation coverage. - `mvn -f server/pom.xml -o -B -ntp -Dspring.profiles.active=dev '-Dtest=org.apache.rocketmq.studio.ops.alert.**' test`: 467 passed, 0 failures/errors/skips; compilation and bound Checkstyle validation passed. - `git diff --cached --check`: passed. The new integration class uses an isolated H2 database in MySQL mode with NON_KEYWORDS=VALUE solely to avoid the independently tracked unquoted-column defect #5131. Production database configuration is unchanged. No live MySQL, live broker, or full repository test run was performed. ### Checklist - [x] One coherent fix; no schema, API shape, or UI changes - [x] Conventional commit subject - [x] New test method ends with Test and new source carries the ASF header - [x] Regression reproduced before the fix and passes afterward - [x] Alert package tests, compilation, Checkstyle, and diff whitespace check pass - [x] Documentation updated -- 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]
