[Mulgara-svn] r1099 - trunk/src/jar/resolver/java/org/mulgara/resolver

ronald at mulgara.org ronald at mulgara.org
Sun Jul 20 23:00:06 UTC 2008


Author: ronald
Date: 2008-07-20 16:00:05 -0700 (Sun, 20 Jul 2008)
New Revision: 1099

Modified:
   trunk/src/jar/resolver/java/org/mulgara/resolver/AdvDatabaseSessionUnitTest.java
   trunk/src/jar/resolver/java/org/mulgara/resolver/ExternalTransactionUnitTest.java
Log:
Fix close test: if we're fast enough the interrupt from the close()
may not have been processed yet, so we can get hit with it in the
Thread.join().


Modified: trunk/src/jar/resolver/java/org/mulgara/resolver/AdvDatabaseSessionUnitTest.java
===================================================================
--- trunk/src/jar/resolver/java/org/mulgara/resolver/AdvDatabaseSessionUnitTest.java	2008-07-20 13:01:56 UTC (rev 1098)
+++ trunk/src/jar/resolver/java/org/mulgara/resolver/AdvDatabaseSessionUnitTest.java	2008-07-20 23:00:05 UTC (rev 1099)
@@ -1588,8 +1588,13 @@
         try {
           t1.join(100L);
         } catch (InterruptedException ie) {
-          logger.error("wait for thread-termination interrupted", ie);
-          fail(ie);
+          // this could be the interrupt from the close(), so try again
+          try {
+            t1.join(100L);
+          } catch (InterruptedException ie2) {
+            logger.error("wait for thread-termination interrupted", ie2);
+            fail(ie2);
+          }
         }
         assertFalse("second session should've terminated", t1.isAlive());
 
@@ -1636,8 +1641,13 @@
         try {
           t1.join(100L);
         } catch (InterruptedException ie) {
-          logger.error("wait for thread-termination interrupted", ie);
-          fail(ie);
+          // this could be the interrupt from the close(), so try again
+          try {
+            t1.join(100L);
+          } catch (InterruptedException ie2) {
+            logger.error("wait for thread-termination interrupted", ie2);
+            fail(ie2);
+          }
         }
         assertFalse("second session should've terminated", t1.isAlive());
 

Modified: trunk/src/jar/resolver/java/org/mulgara/resolver/ExternalTransactionUnitTest.java
===================================================================
--- trunk/src/jar/resolver/java/org/mulgara/resolver/ExternalTransactionUnitTest.java	2008-07-20 13:01:56 UTC (rev 1098)
+++ trunk/src/jar/resolver/java/org/mulgara/resolver/ExternalTransactionUnitTest.java	2008-07-20 23:00:05 UTC (rev 1099)
@@ -2128,8 +2128,13 @@
         try {
           t1.join(100L);
         } catch (InterruptedException ie) {
-          logger.error("wait for thread-termination interrupted", ie);
-          fail(ie);
+          // this could be the interrupt from the close(), so try again
+          try {
+            t1.join(100L);
+          } catch (InterruptedException ie2) {
+            logger.error("wait for thread-termination interrupted", ie2);
+            fail(ie2);
+          }
         }
         assertFalse("second session should've terminated", t1.isAlive());
 




More information about the Mulgara-svn mailing list