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 33911714fec [fix][test] testSingleTopicConsumerBatchShortName (#19253)
33911714fec is described below
commit 33911714fece1d52e28c7c55620ab0d9b44affff
Author: labuladong <[email protected]>
AuthorDate: Sat Jan 28 09:27:30 2023 +0800
[fix][test] testSingleTopicConsumerBatchShortName (#19253)
---
.../org/apache/pulsar/client/impl/TopicFromMessageTest.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git
a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/TopicFromMessageTest.java
b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/TopicFromMessageTest.java
index 0bb12422965..f0d9426cd26 100644
---
a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/TopicFromMessageTest.java
+++
b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/TopicFromMessageTest.java
@@ -19,6 +19,8 @@
package org.apache.pulsar.client.impl;
import com.google.common.collect.Lists;
+import java.util.HashSet;
+import java.util.Set;
import org.apache.pulsar.client.api.Consumer;
import org.apache.pulsar.client.api.Producer;
import org.apache.pulsar.client.api.ProducerConsumerBase;
@@ -76,10 +78,14 @@ public class TopicFromMessageTest extends
ProducerConsumerBase {
.topic("topic1").enableBatching(false).create();
Producer<byte[]> producer2 = pulsarClient.newProducer()
.topic("topic2").enableBatching(false).create()) {
+
+ Set<String> topicSet = new HashSet<>();
+ topicSet.add("persistent://public/default/topic1");
+ topicSet.add("persistent://public/default/topic2");
producer1.send("foobar".getBytes());
producer2.send("foobar".getBytes());
- Assert.assertEquals(consumer.receive().getTopicName(),
"persistent://public/default/topic1");
- Assert.assertEquals(consumer.receive().getTopicName(),
"persistent://public/default/topic2");
+
Assert.assertTrue(topicSet.remove(consumer.receive().getTopicName()));
+
Assert.assertTrue(topicSet.remove(consumer.receive().getTopicName()));
}
}