You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by da...@apache.org on 2011/02/03 20:11:29 UTC

svn commit: r1066911 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/InterruptResilienceTest.java

Author: dag
Date: Thu Feb  3 19:11:29 2011
New Revision: 1066911

URL: http://svn.apache.org/viewvc?rev=1066911&view=rev
Log:
DERBY-5001 Intermittent bug in InterruptResilienceTest

Fix to allow for lock interrupts during writing in the MT RAF test fixture.


Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/InterruptResilienceTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/InterruptResilienceTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/InterruptResilienceTest.java?rev=1066911&r1=1066910&r2=1066911&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/InterruptResilienceTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/InterruptResilienceTest.java Thu Feb  3 19:11:29 2011
@@ -419,7 +419,24 @@ public class InterruptResilienceTest ext
                     } else {
                         s.setLong(1, ops);
                         s.setString(2, getName());
-                        s.executeUpdate();
+
+                        try {
+                            s.executeUpdate();
+                        } catch (SQLException e) {
+                            // Occasionally we could see a lock wait being
+                            // interrupted: reconnect and continue. DERBY-5001.
+                            // See also LockInterruptTest.
+                            if ("08000".equals(e.getSQLState())) {
+                                c = thisConf.openDefaultConnection();
+                                s = c.prepareStatement(pStmtText);
+                                assertTrue(interrupted());
+                                interruptsSeen++;
+                                continue;
+                            } else {
+                                throw new Exception("expected 08000, saw" + e);
+                            }
+                        }
+
 
                         if (Thread.interrupted()) {
                             interruptsSeen++;