You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "oneby-wang (via GitHub)" <gi...@apache.org> on 2026/01/06 04:46:50 UTC
[PR] [fix][test] Wait for txn.abort() to complete to avoid AdminApiTransactionTest.testAnalyzeSubscriptionBacklogWithTransactionMarker() flaky test [pulsar]
oneby-wang opened a new pull request, #25125:
URL: https://github.com/apache/pulsar/pull/25125
### Motivation
Fix `AdminApiTransactionTest.testAnalyzeSubscriptionBacklogWithTransactionMarker()` flaky test.
Example failure:
```
Error: org.apache.pulsar.broker.admin.v3.AdminApiTransactionTest.testAnalyzeSubscriptionBacklogWithTransactionMarker
[INFO] Run 1: PASS
Error: Run 2: AdminApiTransactionTest.testAnalyzeSubscriptionBacklogWithTransactionMarker:1098 expected [20] but found [19]
```
https://github.com/oneby-wang/pulsar/actions/runs/20709883704/job/59448327174?pr=22
### Modifications
Wait for `txn.abort()` to complete to avoid flaky test.
I checked two other test methods for `topics.peekMessages()` that do not use `txn.abort().get()`; I ran these tests a lot of times locally and found them are not flaky.
https://github.com/apache/pulsar/blob/bf98773a2d3f6ecf73560fe4e682ce058dcfde61/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v3/AdminApiTransactionTest.java#L970-L979
https://github.com/apache/pulsar/blob/bf98773a2d3f6ecf73560fe4e682ce058dcfde61/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v3/AdminApiTransactionTest.java#L1019-L1027
I read the source code and found that `topics.peekMessages()` returns only when the specified `numMessages` have been retrieved.
https://github.com/apache/pulsar/blob/bf98773a2d3f6ecf73560fe4e682ce058dcfde61/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TopicsImpl.java#L921-L927
### 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/oneby-wang/pulsar/pull/23
--
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] Wait for txn.abort() to complete to avoid AdminApiTransactionTest.testAnalyzeSubscriptionBacklogWithTransactionMarker() flaky test [pulsar]
Posted by "oneby-wang (via GitHub)" <gi...@apache.org>.
oneby-wang commented on PR #25125:
URL: https://github.com/apache/pulsar/pull/25125#issuecomment-3717411513
/pulsarbot rerun-failure-checks
--
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] Wait for txn.abort() to complete to avoid AdminApiTransactionTest.testAnalyzeSubscriptionBacklogWithTransactionMarker() flaky test [pulsar]
Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower merged PR #25125:
URL: https://github.com/apache/pulsar/pull/25125
--
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] Wait for txn.abort() to complete to avoid AdminApiTransactionTest.testAnalyzeSubscriptionBacklogWithTransactionMarker() flaky test [pulsar]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #25125:
URL: https://github.com/apache/pulsar/pull/25125#issuecomment-3717464424
## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/25125?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 74.48%. Comparing base ([`f101811`](https://app.codecov.io/gh/apache/pulsar/commit/f10181173357b13b690abb288b83a3a458292e2d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`fae9a7f`](https://app.codecov.io/gh/apache/pulsar/commit/fae9a7fac9883ca71c2345e2d8c97bd1cf80f6e2?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 3 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/pulsar/pull/25125?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #25125 +/- ##
=============================================
+ Coverage 38.75% 74.48% +35.73%
- Complexity 13215 33694 +20479
=============================================
Files 1842 1899 +57
Lines 145545 149716 +4171
Branches 16916 17405 +489
=============================================
+ Hits 56400 111516 +55116
+ Misses 81460 29325 -52135
- Partials 7685 8875 +1190
```
| [Flag](https://app.codecov.io/gh/apache/pulsar/pull/25125/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/25125/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.35% <ø> (-0.24%)` | :arrow_down: |
| [systests](https://app.codecov.io/gh/apache/pulsar/pull/25125/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `23.02% <ø> (-0.05%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pulsar/pull/25125/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `74.00% <ø> (+39.45%)` | :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 1407 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/25125/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