You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2022/07/05 01:10:47 UTC
[pulsar] branch master updated: [fix][flaky-test] Try to fix flaky test related to PersistentTopicTest.setup (#16383)
This is an automated email from the ASF dual-hosted git repository.
penghui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new ea45f2faba3 [fix][flaky-test] Try to fix flaky test related to PersistentTopicTest.setup (#16383)
ea45f2faba3 is described below
commit ea45f2faba3a8ccb01bea2ddf5171222fc00b6b7
Author: lipenghui <pe...@apache.org>
AuthorDate: Tue Jul 5 09:10:41 2022 +0800
[fix][flaky-test] Try to fix flaky test related to PersistentTopicTest.setup (#16383)
---
.../java/org/apache/pulsar/broker/service/PersistentTopicTest.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicTest.java
index a65f80e3fc7..76fdc4ff5ac 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicTest.java
@@ -102,6 +102,7 @@ import org.apache.pulsar.broker.ServiceConfiguration;
import org.apache.pulsar.broker.namespace.NamespaceService;
import org.apache.pulsar.broker.resources.NamespaceResources;
import org.apache.pulsar.broker.resources.PulsarResources;
+import org.apache.pulsar.broker.resources.TopicResources;
import org.apache.pulsar.broker.service.persistent.CompactorSubscription;
import org.apache.pulsar.broker.service.persistent.PersistentDispatcherMultipleConsumers;
import org.apache.pulsar.broker.service.persistent.PersistentDispatcherSingleActiveConsumer;
@@ -211,7 +212,9 @@ public class PersistentTopicTest extends MockedBookKeeperTestCase {
store = new ZKMetadataStore(mockZk);
PulsarResources pulsarResources = spyWithClassAndConstructorArgs(PulsarResources.class, store, store);
NamespaceResources nsr = spyWithClassAndConstructorArgs(NamespaceResources.class, store, store, 30);
+ TopicResources tsr = spyWithClassAndConstructorArgs(TopicResources.class, store);
doReturn(nsr).when(pulsarResources).getNamespaceResources();
+ doReturn(tsr).when(pulsarResources).getTopicResources();
doReturn(pulsarResources).when(pulsar).getPulsarResources();
doReturn(store).when(pulsar).getLocalMetadataStore();