Issue 12019 Fix flaky test ManagedLedgerTest.testMaximumRolloverTime
@@ -1775,11 +1775,12 @@ public class ManagedLedgerTest extends MockedBookKeeperTestCase {
assertEquals(ledger.getLedgersInfoAsList().size(), 1);
- Thread.sleep(2000);
-
ledger.addEntry("data".getBytes());
ledger.addEntry("data".getBytes());
+
+ Awaitility.await().untilAsserted(() -> {
assertEquals(ledger.getLedgersInfoAsList().size(), 2);
+ });
}
@Test
