You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "pdolif (via GitHub)" <gi...@apache.org> on 2025/03/01 19:08:18 UTC
[PR] [fix][test] Fix flaky PrometheusMetricsTest.testBrokerMetrics [pulsar]
pdolif opened a new pull request, #24042:
URL: https://github.com/apache/pulsar/pull/24042
Fixes #24041
### Motivation
The test contains the following assertion:
```java
assertEquals(systemCursorOutBytes, systemInBytes)
```
`systemInBytes` is set to the value of the `pulsar_broker_in_bytes_total` metric for the system topic.
`systemCursorOutBytes` is currently set to the value of
- `pulsar_out_bytes_total` of the system reader subscription or
- `pulsar_out_bytes_total` of the compaction subscription.
The `pulsar_out_bytes_total` metric is always present for both the system reader and compaction subscription, but the order is not deterministic. Therefore, it happens that instead of setting `systemCursorOutBytes` to `pulsar_out_bytes_total` for the system reader subscription, it is set to `pulsar_out_bytes_total` of the compaction subscription (which always seems to be 0).
```java
double systemCursorOutBytes = 0.0;
for (Metric metric : topicLevelBytesOutTotal) {
if (metric.tags.get("subscription").startsWith(SystemTopicNames.SYSTEM_READER_PREFIX)
|| metric.tags.get("subscription").equals(Compactor.COMPACTION_SUBSCRIPTION)) {
systemCursorOutBytes = metric.value;
}
}
```
### Modifications
Remove the `metric.tags.get("subscription").equals(Compactor.COMPACTION_SUBSCRIPTION)` case.
### Verifying this change
- [x] Make sure that the change passes the CI checks.
### Does this pull request potentially affect one of the following parts:
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
*If the box was checked, please highlight the changes*
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: https://github.com/pdolif/pulsar/pull/8
--
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@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][test] Fix flaky PrometheusMetricsTest.testBrokerMetrics [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari merged PR #24042:
URL: https://github.com/apache/pulsar/pull/24042
--
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@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][test] Fix flaky PrometheusMetricsTest.testBrokerMetrics [pulsar]
Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- closed pull request #24042: [fix][test] Fix flaky PrometheusMetricsTest.testBrokerMetrics
URL: https://github.com/apache/pulsar/pull/24042
--
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@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][test] Fix flaky PrometheusMetricsTest.testBrokerMetrics [pulsar]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #24042:
URL: https://github.com/apache/pulsar/pull/24042#issuecomment-2696212388
## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/24042?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 73.27%. Comparing base [(`bbc6224`)](https://app.codecov.io/gh/apache/pulsar/commit/bbc62245c5ddba1de4b1e7cee4ab49334bc36277?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`3aac8f4`)](https://app.codecov.io/gh/apache/pulsar/commit/3aac8f4d29988e2955dec3bb7d5abc14275a9ff5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 946 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/pulsar/pull/24042?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #24042 +/- ##
============================================
- Coverage 73.57% 73.27% -0.31%
+ Complexity 32624 2343 -30281
============================================
Files 1877 1861 -16
Lines 139502 144804 +5302
Branches 15299 16538 +1239
============================================
+ Hits 102638 106102 +3464
- Misses 28908 30238 +1330
- Partials 7956 8464 +508
```
| [Flag](https://app.codecov.io/gh/apache/pulsar/pull/24042/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [inttests](https://app.codecov.io/gh/apache/pulsar/pull/24042/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.73% <ø> (+2.15%)` | :arrow_up: |
| [systests](https://app.codecov.io/gh/apache/pulsar/pull/24042/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `23.06% <ø> (-1.26%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pulsar/pull/24042/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `72.99% <ø> (+0.14%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
[see 1066 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/24042/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
--
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@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org