You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "hanmz (via GitHub)" <gi...@apache.org> on 2025/05/22 11:27:42 UTC
[PR] [fix][test] Fix flaky PulsarBrokerStatsClientTest.testTopicInternalStats [pulsar]
hanmz opened a new pull request, #24341:
URL: https://github.com/apache/pulsar/pull/24341
### Motivation
<img width="1398" alt="Clipboard_Screenshot_1747912362" src="https://github.com/user-attachments/assets/d0f22d06-2a35-4e3f-b642-5cff6dd950c8" />
This unit test `assertTrue(cursor.totalNonContiguousDeletedMessagesRange > 0 && (cursor.totalNonContiguousDeletedMessagesRange) < numberOfMsgs / 2)` reports an error because the consumer's acknowledge method is implemented one-way and the server may not have processed the ack request yet before `topic.getInternalStats` , so `totalNonContiguousDeletedMessagesRange` is sometimes equal to 0.
https://github.com/apache/pulsar/blob/bdf6277456db9df1618adcd07b588f3a94714796/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java#L616
At the same time, `assertFalse(cursor.subscriptionHavePendingRead)` sometimes goes wrong unless we close the consumer first.
### Modifications
Optimize assert logic to ensure the robustness of unit tests.
### 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 -->
--
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 PulsarBrokerStatsClientTest.testTopicInternalStats [pulsar]
Posted by "dao-jun (via GitHub)" <gi...@apache.org>.
dao-jun closed pull request #24341: [fix][test] Fix flaky PulsarBrokerStatsClientTest.testTopicInternalStats
URL: https://github.com/apache/pulsar/pull/24341
--
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 PulsarBrokerStatsClientTest.testTopicInternalStats [pulsar]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #24341:
URL: https://github.com/apache/pulsar/pull/24341#issuecomment-2903303762
## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/24341?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 74.23%. 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 [(`e62903b`)](https://app.codecov.io/gh/apache/pulsar/commit/e62903b41f5067fccd0c303497243ec83ae138a7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 1116 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/pulsar/pull/24341?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #24341 +/- ##
============================================
+ Coverage 73.57% 74.23% +0.65%
- Complexity 32624 32630 +6
============================================
Files 1877 1866 -11
Lines 139502 145126 +5624
Branches 15299 16593 +1294
============================================
+ Hits 102638 107733 +5095
+ Misses 28908 28858 -50
- Partials 7956 8535 +579
```
| [Flag](https://app.codecov.io/gh/apache/pulsar/pull/24341/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/24341/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.71% <ø> (+2.13%)` | :arrow_up: |
| [systests](https://app.codecov.io/gh/apache/pulsar/pull/24341/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `23.31% <ø> (-1.01%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pulsar/pull/24341/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.71% <ø> (+0.86%)` | :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 1083 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/24341/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</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
Re: [PR] [fix][test] Fix flaky PulsarBrokerStatsClientTest.testTopicInternalStats [pulsar]
Posted by "dao-jun (via GitHub)" <gi...@apache.org>.
dao-jun commented on PR #24341:
URL: https://github.com/apache/pulsar/pull/24341#issuecomment-2903288222
Good job, I tested locally 4 times and it all passed
--
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 PulsarBrokerStatsClientTest.testTopicInternalStats [pulsar]
Posted by "dao-jun (via GitHub)" <gi...@apache.org>.
dao-jun merged PR #24341:
URL: https://github.com/apache/pulsar/pull/24341
--
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