We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05a703b commit 8d9d497Copy full SHA for 8d9d497
1 file changed
managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java
@@ -2309,8 +2309,10 @@ public void testNoRetention() throws Exception {
2309
c1 = ml.openCursor("c1noretention");
2310
ml.addEntry("shortmessage".getBytes());
2311
c1.skipEntries(1, IndividualDeletedEntries.Exclude);
2312
- // sleep for trim
2313
- Thread.sleep(1000);
+ // Explicitly trigger trimming and wait for it to complete
+ CompletableFuture<Void> trimFuture = new CompletableFuture<>();
2314
+ ml.trimConsumedLedgersInBackground(trimFuture);
2315
+ trimFuture.join();
2316
ml.close();
2317
2318
assertTrue(ml.getLedgersInfoAsList().size() <= 1);
0 commit comments