[
https://issues.apache.org/jira/browse/DERBY-3561?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
John H. Embretsen updated DERBY-3561:
-------------------------------------
Component/s: Test
JMX
Derby Info: [Patch Available]
Patch for fixing this issue by adding a permission to a test policy file is
still available for review/commit.
If some alternative solution is desired, please let me know.
One alternative would be to somehow make this specific test more robust
against such issues (old MBeans left behind by previous tests/systems).
However, it seems hard to make the test robust without also testing less,
e.g. not caring so much about exactly what is left behind after the
"stopManagement" operation is invoked.
For example, the set of MBeans left registered with the MBean server after
invoking "stopManagement" may be something like:
current: org.apache.derby:type=Management
old:
org.apache.derby:system=c013800d-0119-0f15-4c02-00006a7eac81,type=Management
old:
org.apache.derby:jar=derby.jar,system=c013800d-0119-0f15-4c02-00006a7eac81,type=Version
old: org.apache.derby:type=OldDerbySysManagement
current:
org.apache.derby:system=c013800d-0119-0f15-68af-00006a7eac81,type=Management
old:
org.apache.derby:system=c013800d-0119-0f15-4c02-00006a7eac81,type=JDBC
The current test expects the number of MBeans to be 2 (those above marked
with "current") and that these MBeans have type "Management".
I suppose we could change the test so that it expects n - x MBeans, where
n is the number of registered MBeans at test start, and x is the number of
MBeans (belonging to the current Derby system) that we expect to be
unregistered when "stopManagement" is invoked. Currently x = 4.
We could also check that there is no MBean registered with the same system
key property as the current system, apart from the Derby-registered
ManagementMBean itself.
Not so elegant, I guess, but probably more robust. I can try to make a
patch for this if it sounds interesting to anyone. For 10.4.1, though, I think
this
is overkill (the policy fix should suffice). Such a solution could also be
combined with the test policy fix.
> testStartStopManagementFromApplication(org.apache.derbyTesting.functionTests.tests.management.ManagementMBeanTest)junit.framework.AssertionFailedError:
> expected:<2> but was:<5>
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3561
> URL: https://issues.apache.org/jira/browse/DERBY-3561
> Project: Derby
> Issue Type: Bug
> Components: JMX, Regression Test Failure, Test
> Affects Versions: 10.5.0.0
> Reporter: Mike Matrigali
> Assignee: John H. Embretsen
> Attachments: d3561_testPolicyFix.diff, Derby3561ReproStandalone.java,
> Derby3561ReproSuite_notForCommit.diff
>
>
> The following test has been failing consistently in the tinderbox runs since
> about build 636714, unfortunately the run right before this build failed so
> it may be from that one.
> first tinderbox failure I could find:
> http://dbtg.thresher.com/derby/test/tinderbox_trunk16/jvm1.6/testing/testlog/SunOS-5.10_i86pc-i386/636714-org.apache.derbyTesting.functionTests.suites.All_diff.txt
> most recent as of this report:
> http://dbtg.thresher.com/derby/test/tinderbox_trunk16/jvm1.6/testing/testlog/SunOS-5.10_i86pc-i386/639156-org.apache.derbyTesting.functionTests.suites.All_diff.txt
> There was 1 failure:
> 1)
> testStartStopManagementFromApplication(org.apache.derbyTesting.functionTests.tests.management.ManagementMBeanTest)junit.framework.AssertionFailedError:
> expected:<2> but was:<5>
> 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:101)
> 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 message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.