[jboss-svn-commits] JBL Code SVN: r29417 - in labs/jbosstm/trunk/qa: tests/src/org/jboss/jbossts/qa and 3 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Sep 21 09:40:10 EDT 2009


Author: jhalliday
Date: 2009-09-21 09:40:10 -0400 (Mon, 21 Sep 2009)
New Revision: 29417

Added:
   labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/Utils/CrashRecoveryDelays.java
Removed:
   labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/CrashRecovery07Utils/
   labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/CrashRecovery08Utils/
Modified:
   labs/jbosstm/trunk/qa/run-tests.xml
   labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/CrashRecovery07Clients/Client01a.java
   labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/CrashRecovery08Clients/Client01a.java
Log:
Tuned crashrecovery test delays. JBTM-390


Modified: labs/jbosstm/trunk/qa/run-tests.xml
===================================================================
--- labs/jbosstm/trunk/qa/run-tests.xml	2009-09-21 13:25:04 UTC (rev 29416)
+++ labs/jbosstm/trunk/qa/run-tests.xml	2009-09-21 13:40:10 UTC (rev 29417)
@@ -131,9 +131,9 @@
         <!-- <antcall target="junit-tests"><param name="tests" value="crashrecovery05_2"/></antcall> -->
         <!-- crashrecovery06 : 2 tests, 1 minute -->
         <antcall target="junit-tests"><param name="tests" value="crashrecovery06"/></antcall>
-        <!-- crashrecovery07 : 16 tests, 87 minutes -->
+        <!-- crashrecovery07 : 16 tests, 12 minutes -->
         <antcall target="junit-tests"><param name="tests" value="crashrecovery07"/></antcall>
-        <!-- crashrecovery08 : 32 tests, 228 minutes -->
+        <!-- crashrecovery08 : 32 tests, 32 minutes -->
         <!-- <antcall target="junit-tests"><param name="tests" value="crashrecovery08"/></antcall> -->
         <!-- crashrecovery09 : 6 tests, 7 minutes -->
         <antcall target="junit-tests"><param name="tests" value="crashrecovery09"/></antcall>

Modified: labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/CrashRecovery07Clients/Client01a.java
===================================================================
--- labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/CrashRecovery07Clients/Client01a.java	2009-09-21 13:25:04 UTC (rev 29416)
+++ labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/CrashRecovery07Clients/Client01a.java	2009-09-21 13:40:10 UTC (rev 29417)
@@ -58,10 +58,10 @@
 
 
 import org.jboss.jbossts.qa.CrashRecovery07.*;
-import org.jboss.jbossts.qa.CrashRecovery07Utils.Delays;
 import org.jboss.jbossts.qa.Utils.OAInterface;
 import org.jboss.jbossts.qa.Utils.ORBInterface;
 import org.jboss.jbossts.qa.Utils.ServerIORStore;
+import org.jboss.jbossts.qa.Utils.CrashRecoveryDelays;
 
 public class Client01a
 {
@@ -73,16 +73,13 @@
 			OAInterface.initOA();
 
 			int numberOfResources = Integer.parseInt(args[args.length - 2]);
-			int delay;
 
 			String serviceIOR = ServerIORStore.loadIOR(args[args.length - 1]);
 			Service service = ServiceHelper.narrow(ORBInterface.orb().string_to_object(serviceIOR));
 
 			boolean correct = true;
 
-			delay = Delays.recoveryDelay(Integer.parseInt(args[args.length - 3]));
-			System.out.println("Sleeping for " + delay + "ms.");
-			Thread.sleep(delay);
+            CrashRecoveryDelays.awaitRecoveryCR07(Integer.parseInt(args[args.length - 3]));
 
 			ResourceTrace resourceTrace = null;
 

Modified: labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/CrashRecovery08Clients/Client01a.java
===================================================================
--- labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/CrashRecovery08Clients/Client01a.java	2009-09-21 13:25:04 UTC (rev 29416)
+++ labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/CrashRecovery08Clients/Client01a.java	2009-09-21 13:40:10 UTC (rev 29417)
@@ -58,10 +58,10 @@
 
 
 import org.jboss.jbossts.qa.CrashRecovery08.*;
-import org.jboss.jbossts.qa.CrashRecovery08Utils.Delays;
 import org.jboss.jbossts.qa.Utils.OAInterface;
 import org.jboss.jbossts.qa.Utils.ORBInterface;
 import org.jboss.jbossts.qa.Utils.ServerIORStore;
+import org.jboss.jbossts.qa.Utils.CrashRecoveryDelays;
 
 public class Client01a
 {
@@ -73,16 +73,13 @@
 			OAInterface.initOA();
 
 			int numberOfResources = Integer.parseInt(args[args.length - 2]);
-			int delay;
 
 			String serviceIOR = ServerIORStore.loadIOR(args[args.length - 1]);
 			Service service = ServiceHelper.narrow(ORBInterface.orb().string_to_object(serviceIOR));
 
 			boolean correct = true;
 
-			delay = Delays.recoveryDelay(Integer.parseInt(args[args.length - 3]));
-			System.out.println("Sleeping for " + delay + "ms.");
-			Thread.sleep(delay);
+            CrashRecoveryDelays.awaitRecoveryCR08(Integer.parseInt(args[args.length - 3]));
 
 			ResourceTrace resourceTrace = null;
 

Added: labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/Utils/CrashRecoveryDelays.java
===================================================================
--- labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/Utils/CrashRecoveryDelays.java	                        (rev 0)
+++ labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/Utils/CrashRecoveryDelays.java	2009-09-21 13:40:10 UTC (rev 29417)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2009,
+ * @author JBoss Inc.
+ */
+package org.jboss.jbossts.qa.Utils;
+
+import com.arjuna.ats.arjuna.common.RecoveryEnvironmentBean;
+import com.arjuna.ats.arjuna.common.recoveryPropertyManager;
+
+/**
+ * Utility class to hold delay functions for crash recovery tests.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at redhat.com) 2009-09
+ */
+public class CrashRecoveryDelays
+{
+    public static void awaitRecoveryCR07(int num_clients) throws InterruptedException {
+        awaitRecovery(1, num_clients);
+    }
+
+    public static void awaitRecoveryCR08(int num_clients) throws InterruptedException {
+        // due to the way CachedRecoveredTransaction/StatusChecker handle TRANSIENT some of these tests need two passes
+        awaitRecovery(2, num_clients);
+    }
+
+    public static void awaitRecovery(int num_cycles, int num_clients) throws InterruptedException
+    {
+        // Note: this assumes the client is running with the same config as the rec mgr process.
+        RecoveryEnvironmentBean recoveryEnvironmentBean = recoveryPropertyManager.getRecoveryEnvironmentBean();
+        int recoveryCycleTime = recoveryEnvironmentBean.getPeriodicRecoveryPeriod()+recoveryEnvironmentBean.getRecoveryBackoffPeriod();
+        // this timing may be a little tight on some older/busy systems
+        // consider increasing the per-client fudge factor a bit...
+        int delay = ((num_cycles*recoveryCycleTime)+(num_clients*10))*1000;
+        System.out.println("Sleeping for " + delay + " ms.");
+        Thread.sleep(delay);
+    }
+}



More information about the jboss-svn-commits mailing list