You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/10/31 23:11:46 UTC

[GitHub] merlimat closed pull request #2867: Use unique test names in PartitionedProducerConsumerTest to avoid individual tests inter-dependencies

merlimat closed pull request #2867: Use unique test names in PartitionedProducerConsumerTest to avoid individual tests inter-dependencies
URL: https://github.com/apache/pulsar/pull/2867
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/PartitionedProducerConsumerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/PartitionedProducerConsumerTest.java
index ae7757d09e..c7f1a6d6da 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/PartitionedProducerConsumerTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/PartitionedProducerConsumerTest.java
@@ -68,7 +68,7 @@ public void testRoundRobinProducer() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
         int numPartitions = 4;
-        TopicName topicName = TopicName.get("persistent://my-property/my-ns/my-partitionedtopic1");
+        TopicName topicName = TopicName.get("persistent://my-property/my-ns/my-partitionedtopic1-" + System.currentTimeMillis());
 
         admin.topics().createPartitionedTopic(topicName.toString(), numPartitions);
 
@@ -110,7 +110,7 @@ public void testPartitionedTopicNameWithSpecialCharacter() throws Exception {
         int numPartitions = 4;
         final String specialCharacter = "! * ' ( ) ; : @ & = + $ , \\ ? % # [ ]";
         TopicName topicName = TopicName
-                .get("persistent://my-property/my-ns/my-partitionedtopic1" + specialCharacter);
+                .get("persistent://my-property/my-ns/my-partitionedtopic1-" + System.currentTimeMillis() + specialCharacter);
         admin.topics().createPartitionedTopic(topicName.toString(), numPartitions);
 
         // Try to create producer which does lookup and create connection with broker
@@ -126,7 +126,8 @@ public void testSinglePartitionProducer() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
         int numPartitions = 4;
-        TopicName topicName = TopicName.get("persistent://my-property/my-ns/my-partitionedtopic2");
+        TopicName topicName = TopicName
+                .get("persistent://my-property/my-ns/my-partitionedtopic2-" + System.currentTimeMillis());
 
         admin.topics().createPartitionedTopic(topicName.toString(), numPartitions);
 
@@ -167,7 +168,8 @@ public void testKeyBasedProducer() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
         int numPartitions = 4;
-        TopicName topicName = TopicName.get("persistent://my-property/my-ns/my-partitionedtopic3");
+        TopicName topicName = TopicName
+                .get("persistent://my-property/my-ns/my-partitionedtopic3-" + System.currentTimeMillis());
         String dummyKey1 = "dummykey1";
         String dummyKey2 = "dummykey2";
 
@@ -219,7 +221,8 @@ public void testInvalidSequence() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
         int numPartitions = 4;
-        TopicName topicName = TopicName.get("persistent://my-property/my-ns/my-partitionedtopic4");
+        TopicName topicName = TopicName
+                .get("persistent://my-property/my-ns/my-partitionedtopic4-" + System.currentTimeMillis());
         admin.topics().createPartitionedTopic(topicName.toString(), numPartitions);
 
         Consumer<byte[]> consumer = pulsarClient.newConsumer().topic(topicName.toString())
@@ -269,7 +272,8 @@ public void testInvalidSequence() throws Exception {
     public void testSillyUser() throws Exception {
 
         int numPartitions = 4;
-        TopicName topicName = TopicName.get("persistent://my-property/my-ns/my-partitionedtopic5");
+        TopicName topicName = TopicName
+                .get("persistent://my-property/my-ns/my-partitionedtopic5-" + System.currentTimeMillis());
         admin.topics().createPartitionedTopic(topicName.toString(), numPartitions);
 
         Producer<byte[]> producer = null;
@@ -311,7 +315,8 @@ public void testSillyUser() throws Exception {
     @Test(timeOut = 30000)
     public void testDeletePartitionedTopic() throws Exception {
         int numPartitions = 4;
-        TopicName topicName = TopicName.get("persistent://my-property/my-ns/my-partitionedtopic6");
+        TopicName topicName = TopicName
+                .get("persistent://my-property/my-ns/my-partitionedtopic6-" + System.currentTimeMillis());
         admin.topics().createPartitionedTopic(topicName.toString(), numPartitions);
 
         Producer<byte[]> producer = pulsarClient.newProducer().topic(topicName.toString()).create();
@@ -338,7 +343,8 @@ public void testAsyncPartitionedProducerConsumer() throws Exception {
         final Set<String> consumeMsgs = Sets.newHashSet();
 
         int numPartitions = 4;
-        TopicName topicName = TopicName.get("persistent://my-property/my-ns/my-partitionedtopic1");
+        TopicName topicName = TopicName
+                .get("persistent://my-property/my-ns/my-partitionedtopic1-" + System.currentTimeMillis());
 
         admin.topics().createPartitionedTopic(topicName.toString(), numPartitions);
         Producer<byte[]> producer = pulsarClient.newProducer().topic(topicName.toString())
@@ -386,7 +392,8 @@ public void testAsyncPartitionedProducerConsumerQueueSizeOne() throws Exception
         final Set<String> consumeMsgs = Sets.newHashSet();
 
         int numPartitions = 4;
-        TopicName topicName = TopicName.get("persistent://my-property/my-ns/my-partitionedtopic1");
+        TopicName topicName = TopicName
+                .get("persistent://my-property/my-ns/my-partitionedtopic1-" + System.currentTimeMillis());
 
         admin.topics().createPartitionedTopic(topicName.toString(), numPartitions);
 
@@ -436,7 +443,7 @@ public void testFairDistributionForPartitionConsumers() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
         final int numPartitions = 2;
-        final String topicName = "persistent://my-property/my-ns/my-topic";
+        final String topicName = "persistent://my-property/my-ns/my-topic-" + System.currentTimeMillis();
         final String producer1Msg = "producer1";
         final String producer2Msg = "producer2";
         final int queueSize = 10;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services