[jboss-svn-commits] JBL Code SVN: r37890 - labs/jbosstm/branches/JBOSSTS_4_16/atsintegration/tests/classes/com/arjuna/ats/jta/distributed.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Feb 17 12:43:25 EST 2012


Author: tomjenkinson
Date: 2012-02-17 12:43:24 -0500 (Fri, 17 Feb 2012)
New Revision: 37890

Modified:
   labs/jbosstm/branches/JBOSSTS_4_16/atsintegration/tests/classes/com/arjuna/ats/jta/distributed/SimpleIsolatedServers.java
Log:
Updated with checks to make sure that we can't hang in a wait

Modified: labs/jbosstm/branches/JBOSSTS_4_16/atsintegration/tests/classes/com/arjuna/ats/jta/distributed/SimpleIsolatedServers.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_16/atsintegration/tests/classes/com/arjuna/ats/jta/distributed/SimpleIsolatedServers.java	2012-02-16 18:51:54 UTC (rev 37889)
+++ labs/jbosstm/branches/JBOSSTS_4_16/atsintegration/tests/classes/com/arjuna/ats/jta/distributed/SimpleIsolatedServers.java	2012-02-17 17:43:24 UTC (rev 37890)
@@ -258,8 +258,13 @@
 			thread.start();
 		}
 		synchronized (phase2CommitAborted) {
-			if (phase2CommitAborted.getCount() < 2) {
-				phase2CommitAborted.wait();
+		    int waitedCount = 0;
+			while (phase2CommitAborted.getCount() < 2) {
+				phase2CommitAborted.wait(10000);
+				waitedCount++;
+	            if (waitedCount > 2 && phase2CommitAborted.getCount() < 2) {
+	                fail("Servers were not aborted");
+	            }           
 			}
 		}
 
@@ -354,6 +359,9 @@
 			if (phase2CommitAborted.getCount() < 1) {
 				phase2CommitAborted.wait();
 			}
+            if (phase2CommitAborted.getCount() < 1) {
+                fail("Servers were not aborted");
+            }
 		}
 
 		reboot("1000");
@@ -434,6 +442,9 @@
 			if (phase2CommitAborted.getCount() < 1) {
 				phase2CommitAborted.wait();
 			}
+            if (phase2CommitAborted.getCount() < 1) {
+                fail("Servers were not aborted");
+            }
 		}
 
 		reboot("1000");
@@ -520,6 +531,9 @@
 			if (phase2CommitAborted.getCount() < 1) {
 				phase2CommitAborted.wait();
 			}
+            if (phase2CommitAborted.getCount() < 1) {
+                fail("Servers were not aborted");
+            }
 		}
 		reboot("1000");
 		reboot("2000");
@@ -609,6 +623,9 @@
 			if (phase2CommitAborted.getCount() < 1) {
 				phase2CommitAborted.wait();
 			}
+            if (phase2CommitAborted.getCount() < 1) {
+                fail("Servers were not aborted");
+            }
 		}
 		reboot("1000");
 		assertTrue("" + completionCounter.getCommitCount("2000"), completionCounter.getCommitCount("2000") == 0);
@@ -662,6 +679,9 @@
 			if (phase2CommitAborted.getCount() < 1) {
 				phase2CommitAborted.wait();
 			}
+            if (phase2CommitAborted.getCount() < 1) {
+                fail("Servers were not aborted");
+            }
 		}
 
 		reboot("1000");



More information about the jboss-svn-commits mailing list