gaoran10 commented on a change in pull request #11226:
URL: https://github.com/apache/pulsar/pull/11226#discussion_r664441222
##########
File path:
managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java
##########
@@ -2871,4 +2872,22 @@ public void testOpEntryAdd_toString_doesNotThrowNPE(){
", dataLength=" + dataLength +
'}';
}
+
+ @Test
+ public void testLedgerReachMaximumRolloverTime() throws Exception {
+ ManagedLedgerConfig config = new ManagedLedgerConfig();
+ config.setMinimumRolloverTime(1, TimeUnit.MILLISECONDS);
+ config.setMaximumRolloverTime(1, TimeUnit.SECONDS);
+
+ ManagedLedger ml = factory.open("ledger-reach-maximum-rollover-time",
config);
+ long firstLedgerId = ((PositionImpl)
ml.addEntry("test".getBytes())).getLedgerId();
+
+ // the ledger rollover scheduled time is between 1000 and 1050 ms,
+ // wait 1100 ms, the ledger should be rolled over.
+ Awaitility.await()
+ .atMost(1100, TimeUnit.MILLISECONDS)
Review comment:
Yes, I'll increase the time order of magnitude, we could set the maximum
rollover time to 10 seconds and wait 11 seconds? Maybe 1 second is more stable?
--
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]