Derby
  1. Derby
  2. DERBY-5797

AssertionFailedError in functionTests.tests.lang.UpdateStatisticsTest.testDisposableStatsEagerness

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.9.2.2, 10.10.1.1
    • Fix Version/s: 10.8.3.3, 10.9.2.2, 10.10.1.1
    • Component/s: Test
    • Labels:
      None
    • Environment:
      windows XP on vmware, ibm 1.6
    • Bug behavior facts:
      Regression Test Failure

      Description

      I noticed a test failure in UpdateStatisticsTest.testDisposableStatsEagerness.

      The link is: http://people.apache.org/~myrnavl/derby_test_results/main/windows/testlog/ibm16/1345812-suites.All_diff.txt

      The stack trace:

      testDisposableStatsEagerness(org.apache.derbyTesting.functionTests.tests.lang.UpdateStatisticsTest)junit.framework.AssertionFailedError
      at org.apache.derbyTesting.functionTests.tests.lang.UpdateStatisticsTest.testDisposableStatsEagerness(UpdateStatisticsTest.java:594)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:424)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:441)
      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)

        Issue Links

          Activity

          Myrna van Lunteren created issue -
          Hide
          Kristian Waagan added a comment -

          This is likely a test defect, and I believe it is caused by the poorer timer/clock resolution [by default] on Windows and the unfortunate timestamp comparison in the test.
          I've been trying to reproduce this on the Windows systems I have easy access to, but I have been unable to do so this far. I see in the run mentioned above that there was only one failure, but it often comes as a pair (both embedded and client failing).

          I'll rewrite the test logic, either adding a sleep (say 100 ms) or verifying the results using UUIDs instead of timestamps.

          Show
          Kristian Waagan added a comment - This is likely a test defect, and I believe it is caused by the poorer timer/clock resolution [by default] on Windows and the unfortunate timestamp comparison in the test. I've been trying to reproduce this on the Windows systems I have easy access to, but I have been unable to do so this far. I see in the run mentioned above that there was only one failure, but it often comes as a pair (both embedded and client failing). I'll rewrite the test logic, either adding a sleep (say 100 ms) or verifying the results using UUIDs instead of timestamps.
          Hide
          Kristian Waagan added a comment - - edited

          Attaching patch 1a, which makes the test sleep at least one tick on the system timer in critical locations. This should ensure that the timestamps of the statistics entries should differ.

          The patch removes two other sleep-methods. Note that while the method in SecurityPolicyReloadingTest takes an argument of number of seconds to sleep, the method isn't used. My IDE claims that, and I also removed the method before adding the new one in BaseTestCase and the code compiled.

          As for the timer resolution issue, I got a 1ms resolution on the Windows 7 machine I have available, but on a Windows Vista machine I observed a resolution of 15/16ms. Starting Windows Media Player brought it down to 1ms
          I found a paper at [1], which states that the default timer resolution on Windows 7 is 15.6ms (it also discusses timer coalescing).

          Patch ready for review.

          [1] http://msdn.microsoft.com/en-us/windows/hardware/gg463266.aspx

          Show
          Kristian Waagan added a comment - - edited Attaching patch 1a, which makes the test sleep at least one tick on the system timer in critical locations. This should ensure that the timestamps of the statistics entries should differ. The patch removes two other sleep-methods. Note that while the method in SecurityPolicyReloadingTest takes an argument of number of seconds to sleep, the method isn't used. My IDE claims that, and I also removed the method before adding the new one in BaseTestCase and the code compiled. As for the timer resolution issue, I got a 1ms resolution on the Windows 7 machine I have available, but on a Windows Vista machine I observed a resolution of 15/16ms. Starting Windows Media Player brought it down to 1ms I found a paper at [1] , which states that the default timer resolution on Windows 7 is 15.6ms (it also discusses timer coalescing). Patch ready for review. [1] http://msdn.microsoft.com/en-us/windows/hardware/gg463266.aspx
          Kristian Waagan made changes -
          Field Original Value New Value
          Attachment derby-5797-1a-sleep_a_tick.diff [ 12531226 ]
          Kristian Waagan made changes -
          Affects Version/s 10.10.0.0 [ 12321550 ]
          Issue & fix info Patch Available [ 10102 ]
          Hide
          Knut Anders Hatlen added a comment -

          Looks like a good fix to me. +1

          Show
          Knut Anders Hatlen added a comment - Looks like a good fix to me. +1
          Hide
          Kristian Waagan added a comment -

          Thanks, Knut Anders.

          Committed patch 1a to trunk with revision 1347888. I'll backport it later today.

          Show
          Kristian Waagan added a comment - Thanks, Knut Anders. Committed patch 1a to trunk with revision 1347888. I'll backport it later today.
          Hide
          Kristian Waagan added a comment -

          Forgot about this, but now it has been backported to 10.9 with revision 1351215.
          Resolving issue.

          Show
          Kristian Waagan added a comment - Forgot about this, but now it has been backported to 10.9 with revision 1351215. Resolving issue.
          Kristian Waagan made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Issue & fix info Patch Available [ 10102 ]
          Assignee Kristian Waagan [ kristwaa ]
          Fix Version/s 10.9.1.1 [ 12321551 ]
          Fix Version/s 10.10.0.0 [ 12321550 ]
          Resolution Fixed [ 1 ]
          Kathey Marsden made changes -
          Affects Version/s 10.9.2.0 [ 12323562 ]
          Affects Version/s 10.9.1.1 [ 12321551 ]
          Fix Version/s 10.9.2.0 [ 12323562 ]
          Fix Version/s 10.9.1.1 [ 12321551 ]
          Gavin made changes -
          Workflow jira [ 12671963 ] Default workflow, editable Closed status [ 12802088 ]
          Hide
          Mamta A. Satoor added a comment -

          This failure was seen on 10.8 codeline. I will work on backporting it to 10.8
          http://download.java.net/javadesktop/derby/javadb-5579314-report/javadb-task-3689573.html

          junit.framework.AssertionFailedError
          at org.apache.derbyTesting.functionTests.tests.lang.UpdateStatisticsTest.testDisposableStatsEagerness(UpdateStatisticsTest.java:481)
          at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
          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)

          Show
          Mamta A. Satoor added a comment - This failure was seen on 10.8 codeline. I will work on backporting it to 10.8 http://download.java.net/javadesktop/derby/javadb-5579314-report/javadb-task-3689573.html junit.framework.AssertionFailedError at org.apache.derbyTesting.functionTests.tests.lang.UpdateStatisticsTest.testDisposableStatsEagerness(UpdateStatisticsTest.java:481) at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113) 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)
          Hide
          ASF subversion and git services added a comment -

          Commit 1503919 from Mamta A. Satoor in branch 'code/branches/10'
          [ https://svn.apache.org/r1503919 ]

          DERBY-5797: AssertionFailedError in functionTests.tests.lang.UpdateStatisticsTest.testDisposableStatsEagerness

          Backporting from trunk(revision 1347888) into 10.8. The fix was contributed by Knut.

          Show
          ASF subversion and git services added a comment - Commit 1503919 from Mamta A. Satoor in branch 'code/branches/10' [ https://svn.apache.org/r1503919 ] DERBY-5797 : AssertionFailedError in functionTests.tests.lang.UpdateStatisticsTest.testDisposableStatsEagerness Backporting from trunk(revision 1347888) into 10.8. The fix was contributed by Knut.
          Mamta A. Satoor made changes -
          Fix Version/s 10.8.3.1 [ 12323475 ]
          Mamta A. Satoor made changes -
          Link This issue is related to DERBY-6289 [ DERBY-6289 ]
          Hide
          Knut Anders Hatlen added a comment -

          [bulk update] Close all resolved issues that haven't been updated for more than one year.

          Show
          Knut Anders Hatlen added a comment - [bulk update] Close all resolved issues that haven't been updated for more than one year.
          Knut Anders Hatlen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          13d 12h 44m 1 Kristian Waagan 18/Jun/12 07:48
          Resolved Resolved Closed Closed
          807d 1h 42m 1 Knut Anders Hatlen 03/Sep/14 09:31

            People

            • Assignee:
              Kristian Waagan
              Reporter:
              Myrna van Lunteren
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development