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 mi...@apache.org on 2013/04/11 19:58:56 UTC

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

Author: mikem
Date: Thu Apr 11 17:58:55 2013
New Revision: 1467011

URL: http://svn.apache.org/r1467011
Log:
DERBY-6144 nightly regression test failure, intermittent error : testStatisticsCorrectness(org.apache.derbyTesting.functionTests.tests.store.AutomaticIndexStatisticsTest)junit.framework.A

test was asserting that stats had to be created after "now".  I think the
nightly was getting a case where the time was the same.  DERBY-5046 fixed
a different part to the same test to check for greater than now, so implemented
that same fix at the offending line.  Also added some text to be printed with
the variable values if it happens again.


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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsTest.java?rev=1467011&r1=1467010&r2=1467011&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AutomaticIndexStatisticsTest.java Thu Apr 11 17:58:55 2013
@@ -329,7 +329,14 @@ public class AutomaticIndexStatisticsTes
         for (int i=0; i < statsObj.length; i++) {
             IdxStats s = statsObj[i];
             assertEquals(rows, s.rows);
-            assertTrue(s.created.before(now));
+            
+            // DERBY-6144 
+            // Stats cannot have been created after the current time (future).
+            assertFalse(
+                "expected stat created in past:now = " + now + 
+                ";s.created = " + s.created,
+                s.created.compareTo(now) > 0);
+
             switch (s.lcols) {
                 case 1:
                     assertEquals(100, s.card);
@@ -358,7 +365,11 @@ public class AutomaticIndexStatisticsTes
                     ", previous stats created " + earlier,
                     s.created.after(earlier));
             // Stats cannot have been created after the current time (future).
-            assertFalse(s.created.compareTo(now) > 0);
+            assertFalse(
+                "expected stat created in past:now = " + now + 
+                ";s.created = " + s.created,
+                s.created.compareTo(now) > 0);
+
             switch (s.lcols) {
                 case 1:
                     assertEquals(10, s.card);