db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrn...@apache.org
Subject svn commit: r1565761 - in /db/derby/code/branches/10.9: ./ java/testing/org/apache/derbyTesting/functionTests/master/ java/testing/org/apache/derbyTesting/functionTests/suites/ java/testing/org/apache/derbyTesting/functionTests/tests/store/ java/testin...
Date Fri, 07 Feb 2014 18:50:25 GMT
Author: myrnavl
Date: Fri Feb  7 18:50:25 2014
New Revision: 1565761

URL: http://svn.apache.org/r1565761
Log:
DERBY-5630; intermittent test failure in store/lockTableVTI.sql
   backport of revision 1565415; needed to also backport o.a.dT.functionTests.util.Barrier.java

Added:
    db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/store/LockTableVtiTest.java
      - copied unchanged from r1565415, db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/store/LockTableVtiTest.java
    db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/util/Barrier.java
  (with props)
Removed:
    db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/master/lockTableVti.out
    db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/store/lockTableVti.sql
Modified:
    db/derby/code/branches/10.9/   (props changed)
    db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/suites/storemore.runall
    db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/store/_Suite.java

Propchange: db/derby/code/branches/10.9/
------------------------------------------------------------------------------
  Merged /db/derby/code/trunk:r1564608,1564635
  Merged /db/derby/code/branches/10.10:r1565415

Modified: db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/suites/storemore.runall
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/suites/storemore.runall?rev=1565761&r1=1565760&r2=1565761&view=diff
==============================================================================
--- db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/suites/storemore.runall
(original)
+++ db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/suites/storemore.runall
Fri Feb  7 18:50:25 2014
@@ -16,7 +16,6 @@ store/SpaceTable.sql
 store/testsqldecimal.sql
 store/heapscan.sql
 store/removeStubs.sql
-store/lockTableVti.sql
 store/rollForwardBackup.sql
 store/rollForwardRecovery.sql
 store/readlocks.sql

Modified: db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/store/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/store/_Suite.java?rev=1565761&r1=1565760&r2=1565761&view=diff
==============================================================================
--- db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/store/_Suite.java
(original)
+++ db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/store/_Suite.java
Fri Feb  7 18:50:25 2014
@@ -83,6 +83,7 @@ public class _Suite extends BaseTestCase
         suite.addTest(ServicePropertiesFileTest.suite());
         suite.addTest(Derby5234Test.suite());
         suite.addTest(KeepDisposableStatsPropertyTest.suite());
+        suite.addTest(LockTableVtiTest.suite());
         suite.addTest(Derby4923Test.suite());
 
         /* Tests that only run in sane builds */

Added: db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/util/Barrier.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/util/Barrier.java?rev=1565761&view=auto
==============================================================================
--- db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/util/Barrier.java
(added)
+++ db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/util/Barrier.java
Fri Feb  7 18:50:25 2014
@@ -0,0 +1,60 @@
+/*
+ * Derby - Class org.apache.derbyTesting.functionTests.util.Barrier
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
+ */
+
+package org.apache.derbyTesting.functionTests.util;
+
+import junit.framework.Assert;
+
+/**
+ * In the absence of java.util.concurrent.CyclicBarrier on some of the
+ * platforms we test, create our own barrier class. This class allows
+ * threads to wait for one another on specific locations, so that they
+ * know they're all in the expected state.
+ */
+public class Barrier {
+    /** Number of threads to wait for at the barrier. */
+    private int numThreads;
+
+    /** Create a barrier for the specified number of threads. */
+    public Barrier(int numThreads) {
+        this.numThreads = numThreads;
+    }
+
+    /**
+     * Wait until {@code numThreads} have called {@code await()} on this
+     * barrier, then proceed.
+     *
+     * @throws InterruptedException if the thread is interrupted while
+     * waiting for the other threads to reach the barrier.
+     */
+    public synchronized void await() throws InterruptedException {
+        Assert.assertTrue(
+                "Too many threads reached the barrier", numThreads > 0);
+
+        if (--numThreads <= 0) {
+            // All threads have reached the barrier. Go ahead!
+            notifyAll();
+        }
+
+        // Some threads haven't reached the barrier yet. Let's wait.
+        while (numThreads > 0) {
+            wait();
+        }
+    }
+}

Propchange: db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/util/Barrier.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message