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 22:26:27 UTC
[PR] [ISSUE-3830][test] Deepen MetricSampleTest with availability invariants, required fields and label copy [rocketmq-dashboard]
yyqdbngt opened a new pull request, #3830:
URL: https://github.com/apache/rocketmq-dashboard/pull/3830
### Motivation
The existing `MetricSampleTest` covers the value/availability cross-checks only. The remaining record invariants — the unavailable-reason guard, required field validation and defensive label copying — were untested.
### Changes
- `availableSamplesCannotCarryAnUnavailableReason`: an available sample with a reason is rejected.
- `unavailableSamplesMayCarryAnUnavailableReason`: unavailable samples accept and expose a reason with empty labels by default.
- `requiredFieldsAreValidated`: blank metricKey/instanceId raise `IllegalArgumentException` and a null domain raises a `NullPointerException` with its message.
- `labelsAreDefensivelyCopied`: later mutation of the source map does not leak into the sample, and the sample's label map is immutable.
### Verification
```
mvn -B test -Dtest=MetricSampleTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
[INFO] BUILD SUCCESS
```
--
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] [ISSUE-3830][test] Deepen MetricSampleTest with availability invariants, required fields and label copy [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #3830: [ISSUE-3830][test] Deepen MetricSampleTest with availability invariants, required fields and label copy
URL: https://github.com/apache/rocketmq-dashboard/pull/3830
--
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