shibd opened a new pull request, #22489: URL: https://github.com/apache/pulsar/pull/22489
### Motivation #22351 After #22034, the calculation formula for the ledger number should be: `totalEntries / entriesPerLedger + 1`, However, since the creation of the ledger is asynchronous, sometimes the last ledger is not created before the function returns. https://github.com/apache/pulsar/blob/57a616eaa79096af5b49db89c99cd39ccc94ec00/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L1775-L1778 ### Modifications - Add `retryStrategically((test) -> ledger.getState() == ManagedLedgerImpl.State.LedgerOpened,10, 200)` to make sure later ledger creates success. - Modify the ledger quantity and assertions related to `makePosition`. ### Verifying this change - After running it 100 times locally, this test is stable. ### 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 -- 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-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org