db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1621223 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerGeneralTest.java
Date Thu, 28 Aug 2014 22:56:08 GMT
Author: dag
Date: Thu Aug 28 22:56:08 2014
New Revision: 1621223

URL: http://svn.apache.org/r1621223
Log:
DERBY-6628 Intermittent error in TriggerGeneralTest

Patch derby-6628-2.

We decided, instead of filering the unexpected system table locks, to
retry the assert for the lock result set for a while to rule out slow,
lingering (re)compilation locks (by the index statistics daemon?).

If the locks of the system tables hang around for a minute (max
waiting time), something fishy is going on.

We'll run with this for a while, and if we don't see this issue again,
close the issue.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerGeneralTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerGeneralTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerGeneralTest.java?rev=1621223&r1=1621222&r2=1621223&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerGeneralTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerGeneralTest.java
Thu Aug 28 22:56:08 2014
@@ -858,15 +858,12 @@ public final class TriggerGeneralTest ex
         assertUpdateCount(st, 1,
             "delete from t1 where a = 3");
 
-        rs = st.executeQuery("select type, mode, tablename from " +
-                "syscs_diag.lock_table " +
-                "where tablename not like 'SYS%'" + // DERBY-6628: filter
-                                                    // any such compilation lock
-                "order by tablename, type");
-
+        // Check the locks, but retry the correctness of the result set for
+        // a while since we have seen extraneous locks here on several system
+        // tables, which should be released (DERBY-6628)
+        long millis = 60000;
+        boolean ok = false;
         expColNames = new String [] {"TYPE", "MODE", "TABLENAME"};
-        JDBC.assertColumnNames(rs, expColNames);
-
         expRS = new String [][]
         {
             {"ROW", "X", "PARENT"},
@@ -875,14 +872,32 @@ public final class TriggerGeneralTest ex
             {"TABLE", "IX", "T1"}
         };
 
-        try {
-            JDBC.assertFullResultSet(rs, expRS, true);
-        } catch (AssertionFailedError e) {
+
+        while (millis >= 0) {
+            rs = st.executeQuery("select type, mode, tablename from " +
+                    "syscs_diag.lock_table " +
+                    "order by tablename, type");
+
+            JDBC.assertColumnNames(rs, expColNames);
+
+            try {
+                JDBC.assertFullResultSet(rs, expRS, true);
+                ok = true;
+                break;
+            } catch (AssertionFailedError t) {
+                millis -= 2000;
+                try {
+                    Thread.sleep(2000);
+                } catch (InterruptedException e) {}
+            }
+        }
+
+        if (!ok) {
             // DERBY-6628: get more information
             dumpRs(st.executeQuery(
                     "select * from syscs_diag.lock_table " + 
                     "    order by tablename, type"));
-            throw e;
+            fail("Unexpected set of locks found");
         }
 
         rollback();



Mime
View raw message