Derby
  1. Derby
  2. DERBY-5774

Failures in UpdateStatisticsTest (order-dependent test cases)

    Details

    • Type: Bug Bug
    • Status: Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 10.8.3.3, 10.9.1.0
    • Fix Version/s: 10.8.3.3, 10.9.1.0
    • Component/s: Test
    • Labels:
      None
    • Bug behavior facts:
      Regression Test Failure

      Description

      I see two failures in UpdateStatisticsTest. But only in some configurations. It looks like it's dependent on the order in which the test cases run, which may vary on JDK 7.

      Output which shows both the ordering of the test cases and the stack traces:

      (emb)lang.UpdateStatisticsTest.testIndexAndColumnNamedStatistics used 472 ms .
      (emb)lang.UpdateStatisticsTest.testNoExclusiveLockOnTable used 81 ms .
      (emb)lang.UpdateStatisticsTest.testParallelCompilationAndUpdate used 897 ms .
      (emb)lang.UpdateStatisticsTest.testDisposableStatsEagerness used 1801 ms .
      (emb)lang.UpdateStatisticsTest.testUpdateAndDropStatistics used 213 ms F.
      (emb)lang.UpdateStatisticsTest.testDERBY5681 used 284 ms .
      (net)lang.UpdateStatisticsTest.testIndexAndColumnNamedStatistics used 683 ms .
      (net)lang.UpdateStatisticsTest.testNoExclusiveLockOnTable used 56 ms .
      (net)lang.UpdateStatisticsTest.testParallelCompilationAndUpdate used 6173 ms .
      (net)lang.UpdateStatisticsTest.testDisposableStatsEagerness used 1874 ms .
      (net)lang.UpdateStatisticsTest.testUpdateAndDropStatistics used 381 ms F.
      (net)lang.UpdateStatisticsTest.testDERBY5681 used 340 ms
      Time: 21.12
      There were 2 failures:
      1) testUpdateAndDropStatistics(org.apache.derbyTesting.functionTests.tests.lang.UpdateStatisticsTest)junit.framework.AssertionFailedError: Index statistics for <ALL TABLES>
      1:

      {tableId=22480241-0137-6f88-5424-00000ee887c6, tableName=DISPOSABLE_STATS_EAGERNESS_FK, indexName=SQL120521151402080, lcols=1, rows=1000, unique/card=1000, created=2012-05-21 15:14:02.358}

      2:

      {tableId=85ad4247-0137-6f88-5424-00000ee887c6, tableName=DISPOSABLE_STATS_EAGERNESS, indexName=SQL120521151402160, lcols=1, rows=1000, unique/card=1000, created=2012-05-21 15:14:02.342}

      3:

      {tableId=85ad4247-0137-6f88-5424-00000ee887c6, tableName=DISPOSABLE_STATS_EAGERNESS, indexName=SQL120521151402160, lcols=2, rows=1000, unique/card=1000, created=2012-05-21 15:14:02.342}

      4:

      {tableId=85ad4247-0137-6f88-5424-00000ee887c6, tableName=DISPOSABLE_STATS_EAGERNESS, indexName=NU_DISPOSABLE_STATS_EAGERNESS, lcols=1, rows=1000, unique/card=35, created=2012-05-21 15:14:02.382}

      5:

      {tableId=85ad4247-0137-6f88-5424-00000ee887c6, tableName=DISPOSABLE_STATS_EAGERNESS, indexName=SQL120521151402180, lcols=1, rows=1000, unique/card=1000, created=2012-05-21 15:14:02.351}

      expected:<0> but was:<5>
      at org.apache.derbyTesting.junit.IndexStatsUtil.assertStats(IndexStatsUtil.java:132)
      at org.apache.derbyTesting.junit.IndexStatsUtil.assertNoStats(IndexStatsUtil.java:109)
      at org.apache.derbyTesting.functionTests.tests.lang.UpdateStatisticsTest.testUpdateAndDropStatistics(UpdateStatisticsTest.java:153)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:423)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:440)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      2) testUpdateAndDropStatistics(org.apache.derbyTesting.functionTests.tests.lang.UpdateStatisticsTest)junit.framework.AssertionFailedError: Index statistics for <ALL TABLES>
      1:

      {tableId=165f0eb9-0137-6f88-5424-00000ee887c6, tableName=DISPOSABLE_STATS_EAGERNESS, indexName=SQL120521151412330, lcols=1, rows=1000, unique/card=1000, created=2012-05-21 15:14:12.445}

      2:

      {tableId=165f0eb9-0137-6f88-5424-00000ee887c6, tableName=DISPOSABLE_STATS_EAGERNESS, indexName=NU_DISPOSABLE_STATS_EAGERNESS, lcols=1, rows=1000, unique/card=35, created=2012-05-21 15:14:12.489}

      3:

      {tableId=165f0eb9-0137-6f88-5424-00000ee887c6, tableName=DISPOSABLE_STATS_EAGERNESS, indexName=SQL120521151412310, lcols=1, rows=1000, unique/card=1000, created=2012-05-21 15:14:12.442}

      4:

      {tableId=165f0eb9-0137-6f88-5424-00000ee887c6, tableName=DISPOSABLE_STATS_EAGERNESS, indexName=SQL120521151412310, lcols=2, rows=1000, unique/card=1000, created=2012-05-21 15:14:12.442}

      5:

      {tableId=a04eceb3-0137-6f88-5424-00000ee887c6, tableName=DISPOSABLE_STATS_EAGERNESS_FK, indexName=SQL120521151412290, lcols=1, rows=1000, unique/card=1000, created=2012-05-21 15:14:12.452}

      expected:<0> but was:<5>
      at org.apache.derbyTesting.junit.IndexStatsUtil.assertStats(IndexStatsUtil.java:132)
      at org.apache.derbyTesting.junit.IndexStatsUtil.assertNoStats(IndexStatsUtil.java:109)
      at org.apache.derbyTesting.functionTests.tests.lang.UpdateStatisticsTest.testUpdateAndDropStatistics(UpdateStatisticsTest.java:153)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:423)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:440)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)

      FAILURES!!!
      Tests run: 12, Failures: 2, Errors: 0

        Activity

        Hide
        Kristian Waagan added a comment -

        Patch 1a makes the asserts more focused (i.e. check for the table we're modifying), and it adds cleanup code to the test that interferes with the other test(s).

        I don't see the error on my system, so it would be nice if the patch can be tested on a system where the tests fail.

        Patch ready for review.

        Show
        Kristian Waagan added a comment - Patch 1a makes the asserts more focused (i.e. check for the table we're modifying), and it adds cleanup code to the test that interferes with the other test(s). I don't see the error on my system, so it would be nice if the patch can be tested on a system where the tests fail. Patch ready for review.
        Hide
        Knut Anders Hatlen added a comment -

        Thanks, Kristian! The test passed in my environment with the patch, but the order of the test cases had changed again, so my test runs didn't really tell if the problem had been fixed. But it also passed when I modified the suite() method to force the same ordering as in the problematic run, so I think it's OK now. +1 to commit.

        Show
        Knut Anders Hatlen added a comment - Thanks, Kristian! The test passed in my environment with the patch, but the order of the test cases had changed again, so my test runs didn't really tell if the problem had been fixed. But it also passed when I modified the suite() method to force the same ordering as in the problematic run, so I think it's OK now. +1 to commit.
        Hide
        Kristian Waagan added a comment -

        Thanks for testing patch 1a, Knut Anders.
        I committed it to trunk with revision 1341019.

        Resolving issue.

        Show
        Kristian Waagan added a comment - Thanks for testing patch 1a, Knut Anders. I committed it to trunk with revision 1341019. Resolving issue.
        Hide
        ASF subversion and git services added a comment -

        Commit 1498052 from Mamta A. Satoor
        [ https://svn.apache.org/r1498052 ]

        DERBY-5774: Failures in UpdateStatisticsTest (order-dependent test cases)

        The test has changed quite a bit between 10.8 and trunk and hence svn merge ran into conflict so I hand backported the changes to 10.8. Also, did some minor cleanup by dropping the tables at the end of the test fixtures.

        Show
        ASF subversion and git services added a comment - Commit 1498052 from Mamta A. Satoor [ https://svn.apache.org/r1498052 ] DERBY-5774 : Failures in UpdateStatisticsTest (order-dependent test cases) The test has changed quite a bit between 10.8 and trunk and hence svn merge ran into conflict so I hand backported the changes to 10.8. Also, did some minor cleanup by dropping the tables at the end of the test fixtures.
        Hide
        Mamta A. Satoor added a comment - - edited

        The test ran into same failures in 10.8 after it got backported there. So I am backporting(with revision 1498052) the changes for this jira to fix the test failures in10.8.3.1

        Show
        Mamta A. Satoor added a comment - - edited The test ran into same failures in 10.8 after it got backported there. So I am backporting(with revision 1498052) the changes for this jira to fix the test failures in10.8.3.1

          People

          • Assignee:
            Kristian Waagan
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development