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

technoboy 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 3d8858543ba [fix][test] Fix PrometheusMetricsTest.testBrokerConnection 
(#18539)
3d8858543ba is described below

commit 3d8858543ba700985bccdf4bf7484781ae4db45c
Author: Cong Zhao <[email protected]>
AuthorDate: Sat Nov 19 10:19:28 2022 +0800

    [fix][test] Fix PrometheusMetricsTest.testBrokerConnection (#18539)
---
 .../apache/pulsar/broker/stats/PrometheusMetricsTest.java   | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git 
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/PrometheusMetricsTest.java
 
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/PrometheusMetricsTest.java
index b79fdecce95..3a3dcc1ec64 100644
--- 
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/PrometheusMetricsTest.java
+++ 
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/PrometheusMetricsTest.java
@@ -94,9 +94,6 @@ public class PrometheusMetricsTest extends BrokerTestBase {
     protected void setup() throws Exception {
         conf.setTopicLevelPoliciesEnabled(false);
         conf.setSystemTopicEnabled(false);
-        conf.setTransactionCoordinatorEnabled(true);
-        conf.setTransactionLogBatchedWriteEnabled(true);
-        conf.setTransactionPendingAckBatchedWriteEnabled(true);
         super.baseSetup();
         AuthenticationProviderToken.resetMetrics();
     }
@@ -782,6 +779,12 @@ public class PrometheusMetricsTest extends BrokerTestBase {
     // Running the test twice to make sure types are present when generated 
multiple times
     @Test(invocationCount = 2)
     public void testDuplicateMetricTypeDefinitions() throws Exception {
+        cleanup();
+        conf.setTransactionCoordinatorEnabled(true);
+        conf.setTransactionLogBatchedWriteEnabled(true);
+        conf.setTransactionPendingAckBatchedWriteEnabled(true);
+        setup();
+
         Set<String> allPrometheusSuffixString = allPrometheusSuffixEnums();
         Producer<byte[]> p1 = 
pulsarClient.newProducer().topic("persistent://my-property/use/my-ns/my-topic1").create();
         Producer<byte[]> p2 = 
pulsarClient.newProducer().topic("persistent://my-property/use/my-ns/my-topic2").create();
@@ -861,6 +864,10 @@ public class PrometheusMetricsTest extends BrokerTestBase {
 
         p1.close();
         p2.close();
+
+        conf.setTransactionCoordinatorEnabled(false);
+        conf.setTransactionLogBatchedWriteEnabled(false);
+        conf.setTransactionPendingAckBatchedWriteEnabled(false);
     }
 
     /***

Reply via email to