rdhabalia commented on a change in pull request #13073:
URL: https://github.com/apache/pulsar/pull/13073#discussion_r761299955
##########
File path:
managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java
##########
@@ -3393,4 +3393,26 @@ public void testCancellationOfScheduledTasks() throws
Exception {
assertTrue(timeoutTask2.isCancelled());
assertTrue(checkLedgerRollTask2.isCancelled());
}
+
+ @Test
+ public void testInactiveLedgerRollOver() throws Exception {
+ int inactiveLedgerRollOverTimeMs = 5;
+ ManagedLedgerFactoryConfig factoryConf = new
ManagedLedgerFactoryConfig();
+ ManagedLedgerFactory factory = new
ManagedLedgerFactoryImpl(metadataStore, bkc);
+ ManagedLedgerConfig config = new ManagedLedgerConfig();
+ config.setInactiveLedgerRollOverTime(inactiveLedgerRollOverTimeMs,
TimeUnit.MILLISECONDS);
+ ManagedLedgerImpl ledger = (ManagedLedgerImpl)
factory.open("rollover_inactive", config);
+ ManagedCursor cursor = ledger.openCursor("c1");
+
+ int totalAddEntries = 5;
+ for (int i = 0; i < totalAddEntries; i++) {
+ String content = "entry"; // 5 bytes
+ ledger.addEntry(content.getBytes());
Review comment:
it marks activity if it receives a write without depending on failures
or introducing any complexity about the failures. so, I don't see any specific
need for that test.
--
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]