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 d6f2fa18bce [fix][flaky-test] Fix flaky test
testDynamicConfigurationTopicAutoCreationPartitionedWhenDefaultMoreThanMax
(#16385)
d6f2fa18bce is described below
commit d6f2fa18bce49fad2a712c306d23c9937f1103a2
Author: lipenghui <[email protected]>
AuthorDate: Tue Jul 5 10:24:14 2022 +0800
[fix][flaky-test] Fix flaky test
testDynamicConfigurationTopicAutoCreationPartitionedWhenDefaultMoreThanMax
(#16385)
---
.../pulsar/broker/service/BrokerServiceAutoTopicCreationTest.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceAutoTopicCreationTest.java
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceAutoTopicCreationTest.java
index 793013ea350..56858e61f4d 100644
---
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceAutoTopicCreationTest.java
+++
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceAutoTopicCreationTest.java
@@ -37,6 +37,7 @@ import org.apache.pulsar.common.naming.TopicName;
import org.apache.pulsar.common.partition.PartitionedTopicMetadata;
import org.apache.pulsar.common.policies.data.AutoTopicCreationOverride;
import org.apache.pulsar.common.policies.data.TopicType;
+import org.awaitility.Awaitility;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
@@ -510,6 +511,10 @@ public class BrokerServiceAutoTopicCreationTest extends
BrokerTestBase{
// set maxNumPartitionsPerPartitionedTopic, make
maxNumPartitionsPerPartitionedTopic < defaultNumPartitions
admin.brokers().updateDynamicConfiguration("maxNumPartitionsPerPartitionedTopic",
"1");
+ // Make sure the dynamic cache is updated to prevent the flaky test.
+ Awaitility.await().untilAsserted(() ->
+ assertEquals(admin.brokers().getAllDynamicConfigurations()
+ .get("maxNumPartitionsPerPartitionedTopic"), "1"));
topic = "persistent://" + namespaceName +
"/test-dynamicConfiguration-topic-auto-creation-"
+ UUID.randomUUID();
producer = pulsarClient.newProducer().topic(topic).create();