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:37:36 UTC

[PR] test(metrics): deepen MetricSample record validation coverage [rocketmq-dashboard]

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

   ## Summary
   
   Extends the existing `MetricSampleTest` (2 to 6 tests) to pin down the remaining branches of the sample record contract.
   
   Added cases:
   - missing/blank `metricKey` and blank `instanceId` are rejected with their messages, and null `domain`, `availability`, and `collectedAt` fail fast with NPEs carrying the field name;
   - an available sample cannot carry an unavailable reason;
   - labels are defensively copied into an unmodifiable snapshot (later source mutation does not leak in), and null labels normalize to an empty map;
   - unavailable samples carry their reason through the full constructor, while the convenience constructor leaves the reason null.
   
   ## Why
   
   The record is the unit that flows through native collection, snapshots, and alert evaluation; only the value-availability invariants were covered before.
   
   ## Testing
   
   `mvn -B test -Dtest=MetricSampleTest` — 6/6 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(metrics): deepen MetricSample record validation coverage [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #3268: test(metrics): deepen MetricSample record validation coverage
URL: https://github.com/apache/rocketmq-dashboard/pull/3268


-- 
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