lordcheng10 commented on code in PR #18007:
URL: https://github.com/apache/pulsar/pull/18007#discussion_r996647872
##########
managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedCursorTest.java:
##########
@@ -974,6 +974,22 @@ void rewind() throws Exception {
assertEquals(c1.getNumberOfEntries(), 2);
}
+ @Test(timeOut = 20000)
+ void markDeleteThePositionTwice() throws Exception {
+ ManagedLedger ledger = factory.open("my_test_ledger", new
ManagedLedgerConfig().setMaxEntriesPerLedger(10));
+ ManagedCursor cursor = ledger.openCursor("c1");
+ Position p1 = ledger.addEntry("dummy-entry-1".getBytes(Encoding));
+
+ assertEquals(cursor.getNumberOfEntries(), 1);
+
+ cursor.markDelete(p1);
+ assertFalse(cursor.hasMoreEntries());
+ assertEquals(cursor.getNumberOfEntries(), 0);
+
+ // markDelete p1 again
+ cursor.markDelete(p1);
Review Comment:
OK
--
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]