db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r537409 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_Util.java
Date Sat, 12 May 2007 13:08:01 GMT
Author: kahatlen
Date: Sat May 12 06:08:00 2007
New Revision: 537409

URL: http://svn.apache.org/viewvc?view=rev&rev=537409
Log:
DERBY-2635: intermittent failure in T_RawStoreFactory unit test

Disabled the interrupter thread which sometimes caused stray
interrupts in sane builds.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_Util.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_Util.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_Util.java?view=diff&rev=537409&r1=537408&r2=537409
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_Util.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_Util.java Sat
May 12 06:08:00 2007
@@ -1132,7 +1132,8 @@
 	} 
 
 	/**
-	 * Check that it's not possible to get a page which is latched.
+	 * Check that it's not possible to get a page which is already latched by
+	 * the same transaction.
 	 *
 	 * @param c a container handle
 	 * @param pageNumber the page number to check
@@ -1152,14 +1153,18 @@
 				}
 			};
 		Thread interrupter = new Thread(r);
-		interrupter.start();
+		if (!SanityManager.DEBUG) {
+			// don't run the interrupter thread in sane builds, since getPage()
+			// will throw an assert error instead of hanging (DERBY-2635)
+			interrupter.start();
+		}
 
 		try {
 			Page p = c.getPage(pageNumber);
 			throw T_Fail.testFailMsg("got latched page");
 		} catch (StandardException se) {
-			// expect thread interrupted exception
-			if (!se.getMessageId().equals("08000")) {
+			// expect thread interrupted exception in insane builds
+			if (SanityManager.DEBUG || !se.getMessageId().equals("08000")) {
 				throw se;
 			}
 		} catch (RuntimeException e) {
@@ -1175,7 +1180,9 @@
 		}
 
 		try {
-			interrupter.join();
+			if (interrupter.isAlive()) {
+				interrupter.join();
+			}
 		} catch (InterruptedException ie) { }
 	}
 



Mime
View raw message