db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1076117 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/InterruptResilienceTest.java
Date Wed, 02 Mar 2011 06:43:03 GMT
Author: dag
Date: Wed Mar  2 06:43:03 2011
New Revision: 1076117

URL: http://svn.apache.org/viewvc?rev=1076117&view=rev
Log:
DERBY-5074 test failure(s) with IBM 1.4.2 in store.InterruptResilienceTest.testRAFWriteInterrupted:
java.sql.SQLException: The exception 'junit.framework.AssertionFailedError: interrupt flag
lost' was thrown while evaluating an expression.

Patch fix-retry-counting: if we get interrupted reading or writing, we
must retry. The current logic didn't account for this correctly. so
one could end up reading/or writing too few rows and get an assert
failure.


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=1076117&r1=1076116&r2=1076117&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
Wed Mar  2 06:43:03 2011
@@ -384,7 +384,9 @@ public class InterruptResilienceTest ext
 
                 Random rnd = new Random();
 
-                for (long ops = 0; ops < noOps; ops++) {
+                int retries = 0;
+
+                for (long ops = 0; ops < noOps + retries; ops++) {
 
                     if (readertest) {
                         // Arbitrarily select one of the rows int the tables to
@@ -414,6 +416,7 @@ public class InterruptResilienceTest ext
                                 s = c.prepareStatement(pStmtText);
                                 assertTrue(interrupted());
                                 interruptsSeen++;
+                                retries++;
                                 continue;
                             } else {
                                 throw new Exception("expected 08000, saw" + e);
@@ -440,6 +443,7 @@ public class InterruptResilienceTest ext
                                 s = c.prepareStatement(pStmtText);
                                 assertTrue(interrupted());
                                 interruptsSeen++;
+                                retries++;
                                 continue;
                             } else {
                                 throw new Exception("expected 08000, saw" + e);



Mime
View raw message