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 kr...@apache.org on 2011/06/03 15:33:04 UTC

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

Author: kristwaa
Date: Fri Jun  3 13:33:04 2011
New Revision: 1131030

URL: http://svn.apache.org/viewvc?rev=1131030&view=rev
Log:
DERBY-5097: testMTSelect(org.apache.derbyTesting.functionTests.tests.store.AutomaticIndex StatisticsMultiTest)junit.framework.AssertionFailedError: failed to get statistics for table MTSEL (#expected=2, timeout=0) on AIX IBM JDK 1.5

Added timeout to the system table query logic to stop the test from failing
when the index statistic worker thread is starved. A starved worker thread
won't be able to update the statistics soon enough in this test case, so we
give it some time to do its thing after the test query threads have stopped.

Patch file: derby-5097-1a-add_timeout.diff

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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsMultiTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsMultiTest.java?rev=1131030&r1=1131029&r2=1131030&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsMultiTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsMultiTest.java Fri Jun  3 13:33:04 2011
@@ -139,7 +139,11 @@ public class AutomaticIndexStatisticsMul
 
     private void verifyStatistics()
             throws SQLException {
-        IndexStatsUtil stats = new IndexStatsUtil(getConnection());
+        // DERBY-5097: On machines with a single core/CPU the load generated
+        // by the test threads may cause the index statistics daemon worker
+        // thread to be "starved". Add a timeout to give it a chance to do
+        // what it has been told to do.
+        IndexStatsUtil stats = new IndexStatsUtil(getConnection(), 2000);
         IdxStats[] myStats = stats.getStatsTable(TAB, 2);
         for (int i=0; i < myStats.length; i++) {
             IdxStats s = myStats[i];