You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/03/22 08:00:53 UTC
[GitHub] [pulsar] eolivelli commented on a change in pull request #14781: [fix][txn]: fix pending ack is recovering throw CursorAlreadyClosedxception
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org