merlimat opened a new pull request, #25467:
URL: https://github.com/apache/pulsar/pull/25467
## Motivation
`ManagedLedgerTest.testNoRetention` is flaky because it relies on
`Thread.sleep(1000)` for the async ledger trimming to complete, which is not
always sufficient.
### Stack trace
```
ManagedLedgerTest > testNoRetention FAILED
java.lang.AssertionError: expected [true] but found [false]
at org.testng.Assert.fail(Assert.java:110)
at org.testng.Assert.failNotEquals(Assert.java:1577)
at org.testng.Assert.assertTrue(Assert.java:56)
at org.testng.Assert.assertTrue(Assert.java:66)
at ManagedLedgerTest.testNoRetention(ManagedLedgerTest.java:2316)
```
## Modifications
Replace `Thread.sleep(1000)` with explicit
`trimConsumedLedgersInBackground(CompletableFuture)` + `join()` to
deterministically wait for ledger trimming to complete before asserting.
### Documentation
- [x] `doc-not-needed`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]