activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq git commit: Clean up and adjust test timeouts for CI
Date Mon, 16 May 2016 15:24:58 GMT
Repository: activemq
Updated Branches:
  refs/heads/master a2720c465 -> d9c404829


Clean up and adjust test timeouts for CI

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/d9c40482
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/d9c40482
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/d9c40482

Branch: refs/heads/master
Commit: d9c404829298f1a8c67a6d7a732d8e687268b014
Parents: a2720c4
Author: Timothy Bish <tabish121@gmail.com>
Authored: Mon May 16 11:24:50 2016 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Mon May 16 11:24:50 2016 -0400

----------------------------------------------------------------------
 .../activemq/transport/mqtt/PahoMQTTTest.java   | 32 +++++++-------------
 1 file changed, 11 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/d9c40482/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/PahoMQTTTest.java
----------------------------------------------------------------------
diff --git a/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/PahoMQTTTest.java
b/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/PahoMQTTTest.java
index 343c0c8..fbf1156 100644
--- a/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/PahoMQTTTest.java
+++ b/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/PahoMQTTTest.java
@@ -42,7 +42,6 @@ import org.eclipse.paho.client.mqttv3.MqttClient;
 import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
 import org.eclipse.paho.client.mqttv3.MqttMessage;
 import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -161,7 +160,7 @@ public class PahoMQTTTest extends MQTTTestSupport {
         client.publish(ACCOUNT_PREFIX + "1/2/3/4", expectedResult.getBytes(StandardCharsets.UTF_8),
0, false);
 
         // One delivery for topic  ACCOUNT_PREFIX + "#"
-        String result = listener.messageQ.poll(45, TimeUnit.MILLISECONDS);
+        String result = listener.messageQ.poll(20, TimeUnit.SECONDS);
         assertTrue(client.getPendingDeliveryTokens().length == 0);
         assertEquals(expectedResult, result);
 
@@ -169,10 +168,10 @@ public class PahoMQTTTest extends MQTTTestSupport {
         client.publish(ACCOUNT_PREFIX + "a/1/2", expectedResult.getBytes(StandardCharsets.UTF_8),
0, false);
 
         // One delivery for topic  ACCOUNT_PREFIX + "a/1/2"
-        result = listener.messageQ.poll(45, TimeUnit.MILLISECONDS);
+        result = listener.messageQ.poll(20, TimeUnit.SECONDS);
         assertEquals(expectedResult, result);
         // One delivery for topic  ACCOUNT_PREFIX + "#"
-        result = listener.messageQ.poll(45, TimeUnit.MILLISECONDS);
+        result = listener.messageQ.poll(20, TimeUnit.SECONDS);
         assertEquals(expectedResult, result);
         assertTrue(client.getPendingDeliveryTokens().length == 0);
 
@@ -184,7 +183,7 @@ public class PahoMQTTTest extends MQTTTestSupport {
         client.publish(ACCOUNT_PREFIX + "1/2/3", expectedResult.getBytes(StandardCharsets.UTF_8),
0, false);
 
         // One delivery for topic  ACCOUNT_PREFIX + "1/2/3"
-        result = listener.messageQ.poll(45, TimeUnit.MILLISECONDS);
+        result = listener.messageQ.poll(20, TimeUnit.SECONDS);
         assertEquals(expectedResult, result);
         assertTrue(client.getPendingDeliveryTokens().length == 0);
 
@@ -192,15 +191,6 @@ public class PahoMQTTTest extends MQTTTestSupport {
         client.close();
     }
 
-    @Ignore
-    @Test(timeout = 300000)
-    public void testOverlappingTopicsLooped() throws Exception {
-        for (int i = 0; i < 100; ++i) {
-            LOG.info("Running test iteration: {}", i);
-            testOverlappingTopics();
-        }
-    }
-
     @Test(timeout = 90000)
     public void testOverlappingTopics() throws Exception {
 
@@ -218,13 +208,13 @@ public class PahoMQTTTest extends MQTTTestSupport {
         String expectedResult = "hello mqtt broker on hash";
         client.publish(ACCOUNT_PREFIX + "a/b/c", expectedResult.getBytes(StandardCharsets.UTF_8),
0, false);
 
-        String result = listener.messageQ.poll(45, TimeUnit.MILLISECONDS);
+        String result = listener.messageQ.poll(20, TimeUnit.SECONDS);
         assertEquals(expectedResult, result);
         assertTrue(client.getPendingDeliveryTokens().length == 0);
 
         expectedResult = "hello mqtt broker on a different topic";
         client.publish(ACCOUNT_PREFIX + "1/2/3/4/5/6", expectedResult.getBytes(StandardCharsets.UTF_8),
0, false);
-        result = listener.messageQ.poll(45, TimeUnit.MILLISECONDS);
+        result = listener.messageQ.poll(20, TimeUnit.SECONDS);
         assertEquals(expectedResult, result);
         assertTrue(client.getPendingDeliveryTokens().length == 0);
 
@@ -239,18 +229,18 @@ public class PahoMQTTTest extends MQTTTestSupport {
         client.publish(ACCOUNT_PREFIX + "1/2/3", expectedResult.getBytes(StandardCharsets.UTF_8),
0, false);
 
         // One message from topic subscription on ACCOUNT_PREFIX + "#"
-        result = listener.messageQ.poll(45, TimeUnit.MILLISECONDS);
+        result = listener.messageQ.poll(20, TimeUnit.SECONDS);
         assertEquals(expectedResult, result);
 
         // One message from topic subscription on ACCOUNT_PREFIX + "1/2/3"
-        result = listener.messageQ.poll(45, TimeUnit.MILLISECONDS);
+        result = listener.messageQ.poll(20, TimeUnit.SECONDS);
         assertEquals(expectedResult, result);
 
         assertTrue(client.getPendingDeliveryTokens().length == 0);
 
         expectedResult = "hello mqtt broker on some other topic";
         client.publish(ACCOUNT_PREFIX + "a/b/c/d/e", expectedResult.getBytes(StandardCharsets.UTF_8),
0, false);
-        result = listener.messageQ.poll(45, TimeUnit.MILLISECONDS);
+        result = listener.messageQ.poll(20, TimeUnit.SECONDS);
         assertEquals(expectedResult, result);
         assertTrue(client.getPendingDeliveryTokens().length == 0);
 
@@ -361,11 +351,11 @@ public class PahoMQTTTest extends MQTTTestSupport {
         String message = "Message from client: " + clientId;
         client1.publish(topic, message.getBytes(StandardCharsets.UTF_8), 1, false);
 
-        String result = client1MqttCallback.messageQ.poll(45, TimeUnit.MILLISECONDS);
+        String result = client1MqttCallback.messageQ.poll(10, TimeUnit.SECONDS);
         assertEquals(message, result);
         assertEquals(1, client1MqttCallback.received.get());
 
-        result = clientAdminMqttCallback.messageQ.poll(45, TimeUnit.MILLISECONDS);
+        result = clientAdminMqttCallback.messageQ.poll(10, TimeUnit.SECONDS);
         assertEquals(message, result);
 
         assertTrue(client1.isConnected());


Mime
View raw message