activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1511842 - in /activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft: DbRestartJDBCQueueMasterSlaveLeaseQuiesceTest.java DbRestartJDBCQueueMasterSlaveLeaseTest.java DbRestartJDBCQueueMasterSlaveTest.java
Date Thu, 08 Aug 2013 15:54:59 GMT
Author: gtully
Date: Thu Aug  8 15:54:59 2013
New Revision: 1511842

URL: http://svn.apache.org/r1511842
Log:
extend the lease period in the test to make more deterministic wrt timing

Modified:
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveLeaseQuiesceTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveLeaseTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveLeaseQuiesceTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveLeaseQuiesceTest.java?rev=1511842&r1=1511841&r2=1511842&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveLeaseQuiesceTest.java
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveLeaseQuiesceTest.java
Thu Aug  8 15:54:59 2013
@@ -26,7 +26,7 @@ import org.slf4j.LoggerFactory;
 public class DbRestartJDBCQueueMasterSlaveLeaseQuiesceTest extends DbRestartJDBCQueueMasterSlaveLeaseTest
{
     private static final transient Logger LOG = LoggerFactory.getLogger(DbRestartJDBCQueueMasterSlaveLeaseQuiesceTest.class);
 
-    private long restartDelay = 500;
+    private long restartDelay = 2000;
 
     @Override
     protected void configureBroker(BrokerService brokerService) {
@@ -37,7 +37,7 @@ public class DbRestartJDBCQueueMasterSla
 
     @Override
     protected void delayTillRestartRequired() {
-        if (restartDelay > 500) {
+        if (restartDelay > 2000) {
             LOG.info("delay for more than lease quantum. While Db is offline, master should
stay alive but could loose lease");
         } else {
             LOG.info("delay for less than lease quantum. While Db is offline, master should
stay alive");
@@ -61,12 +61,12 @@ public class DbRestartJDBCQueueMasterSla
 
     @Override
     public void setUp() throws Exception {
-        restartDelay = 500;
+        restartDelay = 2000;
         super.setUp();
     }
 
     public void testSendReceiveWithLeaseExpiry() throws Exception {
-        restartDelay = 3000;
+        restartDelay = 10000;
         testSendReceive();
     }
 

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveLeaseTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveLeaseTest.java?rev=1511842&r1=1511841&r2=1511842&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveLeaseTest.java
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveLeaseTest.java
Thu Aug  8 15:54:59 2013
@@ -51,10 +51,10 @@ public class DbRestartJDBCQueueMasterSla
     }
 
     private long getLockKeepAlivePeriod() {
-        return 500;
+        return 1000;
     }
 
     private long getLockAcquireSleepInterval() {
-        return 2000;
+        return 8000;
     }
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java?rev=1511842&r1=1511841&r2=1511842&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java
Thu Aug  8 15:54:59 2013
@@ -30,6 +30,7 @@ import javax.jms.TransactionRolledBackEx
 import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.command.ActiveMQMessage;
+import org.apache.activemq.command.MessageId;
 import org.apache.activemq.store.jdbc.JDBCPersistenceAdapter;
 import org.apache.derby.jdbc.EmbeddedDataSource;
 import org.slf4j.Logger;
@@ -114,15 +115,16 @@ public class DbRestartJDBCQueueMasterSla
                     java.sql.Connection dbConnection = null;
                     try {
                         ActiveMQMessage mqMessage = (ActiveMQMessage) message;
+                        MessageId id = mqMessage.getMessageId();
                         dbConnection = sharedDs.getConnection();
                         PreparedStatement s = dbConnection.prepareStatement(((JDBCPersistenceAdapter)
connectedToBroker().getPersistenceAdapter()).getStatements().getFindMessageStatement());
-                        s.setString(1, mqMessage.getMessageId().getProducerId().toString());
-                        s.setLong(2, mqMessage.getMessageId().getProducerSequenceId());
+                        s.setString(1, id.getProducerId().toString());
+                        s.setLong(2, id.getProducerSequenceId());
                         ResultSet rs = s.executeQuery();
 
                         if (!rs.next()) {
                             // message is gone, so lets count it as consumed
-                            LOG.info("On TransactionRolledBackException we know that the
ack/commit got there b/c message is gone so we  count it: " + mqMessage);
+                            LOG.info("On TransactionRolledBackException we know that the
ack/commit got there b/c message is gone so we count it: " + mqMessage);
                             super.consumeMessage(message, messageList);
                         } else {
                             LOG.info("On TransactionRolledBackException we know that the
ack/commit was lost so we expect a replay of: " + mqMessage);



Mime
View raw message