eolivelli commented on a change in pull request #11226:
URL: https://github.com/apache/pulsar/pull/11226#discussion_r664348235
##########
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:
I am not sure that on CI we can rely on making the difference in the
order of 100ms
it is possible that the machine is very slow and then we will see the test
failing
--
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]