You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by rg...@apache.org on 2022/03/01 16:24:11 UTC

[pulsar] 02/21: [Transaction] Optimize testEndTBRecoveringWhenManagerLedgerDisReadable (#14303)

This is an automated email from the ASF dual-hosted git repository.

rgao pushed a commit to branch branch-2.9
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit b70f6cdcd3a48550795c2e0e4de86669867b0586
Author: Xiangying Meng <55...@users.noreply.github.com>
AuthorDate: Wed Feb 16 11:50:41 2022 +0800

    [Transaction] Optimize testEndTBRecoveringWhenManagerLedgerDisReadable (#14303)
    
    ### Motivation
    The time used by clean up is too long.
    This is because the broker service fails to execute the `unloadserviceunit`, and can only rely on the timeout mechanism to cancel the `unloadserviceunit` this time. As a result, the clean up takes too much time. The root cause is that there is a mock cursor in `ManagerLedger.cursors`.
    ### Modification
    Remove the cursor from  `ManagerLedger.cursors` after test.
    
    (cherry picked from commit a43fab0045a93ee864da6bc386bcc0e8bf17bf11)
---
 .../test/java/org/apache/pulsar/broker/transaction/TransactionTest.java  | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/TransactionTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/TransactionTest.java
index b627438..b882d26 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/TransactionTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/TransactionTest.java
@@ -562,6 +562,7 @@ public class TransactionTest extends TransactionTestBase {
         TransactionBuffer buffer2 = new TopicTransactionBuffer(persistentTopic);
         Awaitility.await().atMost(30, TimeUnit.SECONDS).untilAsserted(() ->
                 assertEquals(buffer2.getStats().state, "Ready"));
+        managedCursors.removeCursor("transaction-buffer-sub");
     }
 
     @Test