Derby
  1. Derby
  2. DERBY-4356

testStartStopManagementFromApplication(org.apache.derbyTesting.functionTests.tests.management.ManagementMBeanTest)junit.framework.AssertionFailedError: expected:<2> but was:<%>

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.4.2.1, 10.5.3.1, 10.6.1.0
    • Fix Version/s: 10.4.2.1, 10.5.3.1, 10.6.1.0
    • Component/s: JMX, Test
    • Labels:
      None
    • Environment:
      All

      Description

      Seen with svn r805448 on tinderbox/trunk ( http://dbtg.foundry.sun.com/derby/test/tinderbox_trunk16/jvm1.6/testing/Limited/index.html ).

      See e.g.
      http://dbtg.foundry.sun.com/derby/test/tinderbox_trunk16/jvm1.6/testing/Limited/testSummary-805576.html ,
      http://dbtg.foundry.sun.com/derby/test/Daily/jvm1.6/testing/Limited/testSummary-805470.html .

      The failure signature is

      testStartStopManagementFromApplication(org.apache.derbyTesting.functionTests.tests.management.ManagementMBeanTest)junit.framework.AssertionFailedError: expected:<2> but was:<14>
      at org.apache.derbyTesting.functionTests.tests.management.ManagementMBeanTest.startStopManagement(ManagementMBeanTest.java:86)
      at org.apache.derbyTesting.functionTests.tests.management.ManagementMBeanTest.testStartStopManagementFromApplication(ManagementMBeanTest.java:56)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
      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)

      This seems to be a similar failure signature as for DERBY-3561 and DERBY-3499. I choose to create a new issue for the new occurrences.

      1. derby-4356-01-aa-noCanary.diff
        6 kB
        Rick Hillegas
      2. z.diff
        2 kB
        Rick Hillegas

        Issue Links

          Activity

          Ole Solberg created issue -
          Ole Solberg made changes -
          Field Original Value New Value
          Link This issue is related to DERBY-3561 [ DERBY-3561 ]
          Ole Solberg made changes -
          Link This issue is related to DERBY-3499 [ DERBY-3499 ]
          Ole Solberg made changes -
          Affects Version/s 10.4.3.0 [ 12313654 ]
          Hide
          Ole Solberg added a comment -

          On Windows platforms we also see

          testDefault(org.apache.derbyTesting.functionTests.tests.engine.ErrorStreamTest)junit.framework.AssertionFailedError: File C:\cygwin\export\home\tmp\os136789\testingDerbyJDK16Jvm1.6\CYGWIN_NT-5.1_i686-unknown\org.apache.derbyTesting.functionTests.suites.All\system\derby.log could not be deleted
          at org.apache.derbyTesting.functionTests.tests.engine.ErrorStreamTest.testDefault(ErrorStreamTest.java:135)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)

          which is similar to DERBY-3202.

          Show
          Ole Solberg added a comment - On Windows platforms we also see testDefault(org.apache.derbyTesting.functionTests.tests.engine.ErrorStreamTest)junit.framework.AssertionFailedError: File C:\cygwin\export\home\tmp\os136789\testingDerbyJDK16Jvm1.6\CYGWIN_NT-5.1_i686-unknown\org.apache.derbyTesting.functionTests.suites.All\system\derby.log could not be deleted at org.apache.derbyTesting.functionTests.tests.engine.ErrorStreamTest.testDefault(ErrorStreamTest.java:135) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109) which is similar to DERBY-3202 .
          Hide
          Knut Anders Hatlen added a comment -

          I've posted a comment about these failures on DERBY-700 since they started when the patch for that issue went in.

          Show
          Knut Anders Hatlen added a comment - I've posted a comment about these failures on DERBY-700 since they started when the patch for that issue went in.
          Knut Anders Hatlen made changes -
          Link This issue relates to DERBY-700 [ DERBY-700 ]
          Hide
          Rick Hillegas added a comment -

          Attaching z.diff. This adds a dummy script class, ZSuite which is useful for reproducing instances of this bug. To use this class:

          1) Apply the patch

          2) Edit ZSuite to replace ClassLoaderBootTest with whatever upstream test has left the cruft which is causing these downstream diffs.

          3) Run the script like so:

          java -Xmx512m junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.management.ZSuite

          Show
          Rick Hillegas added a comment - Attaching z.diff. This adds a dummy script class, ZSuite which is useful for reproducing instances of this bug. To use this class: 1) Apply the patch 2) Edit ZSuite to replace ClassLoaderBootTest with whatever upstream test has left the cruft which is causing these downstream diffs. 3) Run the script like so: java -Xmx512m junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.management.ZSuite
          Rick Hillegas made changes -
          Attachment z.diff [ 12417143 ]
          Hide
          Rick Hillegas added a comment -

          Attaching derby-4356-01-aa-noCanary.diff. This patch tries to make ManagementBeanTest defensively insulate itself from artifacts left over from other tests. The test now runs cleanly both standalone and in a suite in which a preceding test (ClassLoaderBootTest) leaves some cruft hanging around. I will run the full regression suite next.

          ManagementBeanTest has turned out to be very noisy. This patch attempts to make the test less sensitive to cruft left over from previous tests. Instead of expecting a fixed number of MBeans, the test now measures differences in the number of MBeans produced by the start and stop operations.

          Along the way, I discovered how many of each kind of MBean we expect to start and stop. I coded this information into the assertions. Previously the test just measured the total number of MBeans.

          I hope that these changes make the test

          1) More sensitive to facts which it is trying to measure.

          2) Less sensitive to facts which it is not trying to measure.

          Touches the following file:

          M java/testing/org/apache/derbyTesting/functionTests/tests/management/ManagementMBeanTest.java

          Show
          Rick Hillegas added a comment - Attaching derby-4356-01-aa-noCanary.diff. This patch tries to make ManagementBeanTest defensively insulate itself from artifacts left over from other tests. The test now runs cleanly both standalone and in a suite in which a preceding test (ClassLoaderBootTest) leaves some cruft hanging around. I will run the full regression suite next. ManagementBeanTest has turned out to be very noisy. This patch attempts to make the test less sensitive to cruft left over from previous tests. Instead of expecting a fixed number of MBeans, the test now measures differences in the number of MBeans produced by the start and stop operations. Along the way, I discovered how many of each kind of MBean we expect to start and stop. I coded this information into the assertions. Previously the test just measured the total number of MBeans. I hope that these changes make the test 1) More sensitive to facts which it is trying to measure. 2) Less sensitive to facts which it is not trying to measure. Touches the following file: M java/testing/org/apache/derbyTesting/functionTests/tests/management/ManagementMBeanTest.java
          Rick Hillegas made changes -
          Attachment derby-4356-01-aa-noCanary.diff [ 12417504 ]
          Hide
          Dag H. Wanvik added a comment -

          I verified that the test fails when run with ZSuite and works after applying the patch.
          The changes look good to me; +1
          Minor comment:

          • The new private methods of test do have Javadoc comments, but lack @params and @throws tags.
          • some lines are > 80 long
          Show
          Dag H. Wanvik added a comment - I verified that the test fails when run with ZSuite and works after applying the patch. The changes look good to me; +1 Minor comment: The new private methods of test do have Javadoc comments, but lack @params and @throws tags. some lines are > 80 long
          Hide
          Rick Hillegas added a comment -

          Thanks for the quick sanity check, Dag. Committed at subversion revision 807685.

          Show
          Rick Hillegas added a comment - Thanks for the quick sanity check, Dag. Committed at subversion revision 807685.
          Rick Hillegas made changes -
          Assignee Rick Hillegas [ rhillegas ]
          Rick Hillegas made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Myrna van Lunteren added a comment -

          Rick, did you mean to backport this to 10.5 and 10.4? The test fails there too, I think...
          If you didn't plan on doing that, I can do it...

          Show
          Myrna van Lunteren added a comment - Rick, did you mean to backport this to 10.5 and 10.4? The test fails there too, I think... If you didn't plan on doing that, I can do it...
          Hide
          Rick Hillegas added a comment -

          Thanks for the reminder, Myrna. Ported 807685 from trunk to 10.5 at subversion revision 807713.

          Show
          Rick Hillegas added a comment - Thanks for the reminder, Myrna. Ported 807685 from trunk to 10.5 at subversion revision 807713.
          Hide
          Rick Hillegas added a comment -

          Ported 807685 from trunk to 10.4 at subversion revision 807715.

          Show
          Rick Hillegas added a comment - Ported 807685 from trunk to 10.4 at subversion revision 807715.
          Kathey Marsden made changes -
          Fix Version/s 10.4.2.1 [ 12313401 ]
          Fix Version/s 10.5.3.1 [ 12314182 ]
          Fix Version/s 10.6.0.0 [ 12313727 ]
          Dag H. Wanvik made changes -
          Affects Version/s 10.5.3.1 [ 12314182 ]
          Affects Version/s 10.5.4.0 [ 12314154 ]
          Dag H. Wanvik made changes -
          Affects Version/s 10.4.2.1 [ 12313401 ]
          Affects Version/s 10.4.3.0 [ 12313654 ]
          Knut Anders Hatlen made changes -
          Link This issue relates to DERBY-4925 [ DERBY-4925 ]
          Kathey Marsden made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Workflow jira [ 12473565 ] Default workflow, editable Closed status [ 12800078 ]

            People

            • Assignee:
              Rick Hillegas
              Reporter:
              Ole Solberg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development