eolivelli commented on a change in pull request #14781:
URL: https://github.com/apache/pulsar/pull/14781#discussion_r831867147



##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/TransactionTest.java
##########
@@ -620,6 +620,17 @@ public void 
testEndTPRecoveringWhenManagerLedgerDisReadable() throws Exception{
         PendingAckHandleImpl pendingAckHandle2 = new 
PendingAckHandleImpl(persistentSubscription);
         Awaitility.await().untilAsserted(() ->
                 assertEquals(pendingAckHandle2.getStats().state, "Ready"));
+
+        doAnswer(invocation -> {
+            AsyncCallbacks.ReadEntriesCallback callback = 
invocation.getArgument(1);
+            callback.readEntriesFailed(new 
ManagedLedgerException.CursorAlreadyClosedException("test"), null);
+            return null;
+        }).when(managedCursor).asyncReadEntries(anyInt(), any(), any(), any());
+
+        PendingAckHandleImpl pendingAckHandle3 = new 
PendingAckHandleImpl(persistentSubscription);
+
+        Awaitility.await().untilAsserted(() ->
+                assertEquals(pendingAckHandle2.getStats().state, "Ready"));

Review comment:
       did you mean `pendingAckHandle3` here ?




-- 
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]


Reply via email to