osgi / bugzilla-archive

Archive of OSGi Alliance Specification Bugzilla bugs. The Specification Bugzilla system was decommissioned with the move to GitHub. The issues in this repository are imported from the Specification Bugzilla system for archival purposes.
0 stars 1 forks source link

[DS] CT fails in test testManagedServiceFactory #2983

Closed bjhargrave closed 5 years ago

bjhargrave commented 5 years ago

Original bug ID: BZ#3115 From: @cziegeler Reported version: R7

bjhargrave commented 5 years ago

Comment author: @cziegeler

The test testManagedServiceFactory fails for me consistently. I had this on my previous Mac and now have it with my new machine as well. The test looks ok and it seems to work on other machines. I've no clue what could go wrong here

>> testManagedServiceFactory(org.osgi.test.cases.component.junit.DeclarativeServicesControl)

got bundle context org.eclipse.osgi.internal.framework.BundleContextImpl@ 7c0c77c7 from org.osgi.test.cases.component_7.0.0.201902072209-SNAPSHOT [7] in state 32

set context through setter

Using default permissions for bundleentry://7.fwk11003494/tb1.jar

No permissions for bundleentry://7.fwk11003494/tb1.jar

Using default permissions for bundleentry://7.fwk11003494/tb2.jar

No permissions for bundleentry://7.fwk11003494/tb2.jar

Using default permissions for bundleentry://7.fwk11003494/tb3.jar

No permissions for bundleentry://7.fwk11003494/tb3.jar

add failure to testManagedServiceFactory(org.osgi.test.cases.component.junit.DeclarativeServicesControl) : The service should be updated with new instance expected not same

junit.framework.AssertionFailedError: The service should be updated with new instance expected not same at junit.framework.Assert.fail(Assert.java:57) at junit.framework.Assert.failSame(Assert.java:320) at junit.framework.Assert.assertNotSame(Assert.java:306) at junit.framework.TestCase.assertNotSame(TestCase.java:475) at org.osgi.test.cases.component.junit.DeclarativeServicesControl.testManagedServiceFactory(DeclarativeServicesControl.java:817) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at junit.framework.TestCase.runTest(TestCase.java:176) at junit.framework.TestCase.runBare(TestCase.java:141) at junit.framework.TestResult$1.protect(TestResult.java:122) at junit.framework.TestResult.runProtected(TestResult.java:142) at junit.framework.TestResult.run(TestResult.java:125) at junit.framework.TestCase.run(TestCase.java:129) at junit.framework.TestSuite.runTest(TestSuite.java:252) at junit.framework.TestSuite.run(TestSuite.java:247) at junit.framework.TestSuite.runTest(TestSuite.java:252) at junit.framework.TestSuite.run(TestSuite.java:247) at aQute.junit.Activator.test(Activator.java:340) at aQute.junit.Activator.automatic(Activator.java:236) at aQute.junit.Activator.run(Activator.java:177) at aQute.launcher.Launcher.lambda$serviceChanged$0(Launcher.java:1377) at aQute.launcher.Launcher.run(Launcher.java:349) at aQute.launcher.Launcher.main(Launcher.java:149)

<< testManagedServiceFactory(org.osgi.test.cases.component.junit.DeclarativeServicesControl), fails=1, errors=0

bjhargrave commented 5 years ago

Comment author: @bjhargrave

I don't see this on my compute or in any of the CI builds. So there must be something up with your system. I can only suspect that the 2 second sleep does not have enough time for SCR to react to the CM update.

Since you work on both the CM and SCR implementations, perhaps is it possible your ~/.m2/repository cache (which is were Bnd will get the jars since it is the default local cache for the maven repo) may be somehow corrupt?

Try either wiping out your local ~/.m2/repository folder or specifying -Dmaven.repo.local=some/new/empty/folder on the gradle command when building and testing to force the maven repo in Bnd to redownload all dependencies from maven central?

bjhargrave commented 5 years ago

Comment author: @cziegeler

Ok...if we really think that this is a faulty maven dependency, then I think its most likely not my system where it is wrong. I used now a freshly setup Mac with just Java 8 installed, no maven, no .m2 folder and run the tests and it fails with the same problem

bjhargrave commented 5 years ago

Comment author: @bjhargrave

¯_(ツ)_/¯

bjhargrave commented 5 years ago

Comment author: @cziegeler

Maybe someone else could try it with a fresh env as well?

bjhargrave commented 5 years ago

Comment author: @cziegeler

Not sure if it has anything do to with this, but on a later test cases I get this exception in the log (which does not make that test case fail):

>> testConfigurationMultiplePIDsFactory130(org.osgi.test.cases.component.junit.DeclarativeServicesControl)

got bundle context org.eclipse.osgi.internal.framework.BundleContextImpl@ 7c0c77c7 from org.osgi.test.cases.component_7.0.0.201902142117-SNAPSHOT [7] in state 32

set context through setter

Using default permissions for bundleentry://7.fwk11003494/tb1.jar

No permissions for bundleentry://7.fwk11003494/tb1.jar

Using default permissions for bundleentry://7.fwk11003494/tb2.jar

No permissions for bundleentry://7.fwk11003494/tb2.jar

Using default permissions for bundleentry://7.fwk11003494/tb3.jar

No permissions for bundleentry://7.fwk11003494/tb3.jar

2019-02-18 09:38:01.525 Log DebugAn error occurred while processing orphaned coordination "ds-test" with ID "1". org.osgi.service.coordinator.CoordinationException: Coordination "ds-test" with ID "1" has failed. at org.eclipse.equinox.coordinator.CoordinationImpl.checkTerminated(CoordinationImpl.java:422) at org.eclipse.equinox.coordinator.CoordinationImpl.terminate(CoordinationImpl.java:430) at org.eclipse.equinox.coordinator.CoordinationImpl.end(CoordinationImpl.java:174) at org.eclipse.equinox.coordinator.CoordinationWeakReference.processOrphanedCoordinations(CoordinationWeakReference.java:37) at org.eclipse.equinox.coordinator.CoordinatorImpl.peek(CoordinatorImpl.java:212) at org.apache.felix.cm.impl.CoordinatorUtil.addToCoordination(CoordinatorUtil.java:75) at org.apache.felix.cm.impl.ConfigurationManager.fireConfigurationEvent(ConfigurationManager.java:644) at org.apache.felix.cm.impl.ConfigurationManager.updated(ConfigurationManager.java:588) at org.apache.felix.cm.impl.ConfigurationImpl.update(ConfigurationImpl.java:460) at org.apache.felix.cm.impl.ConfigurationAdapter.update(ConfigurationAdapter.java:145) at org.osgi.test.cases.component.junit.DeclarativeServicesControl.testConfigurationMultiplePIDsFactory130(DeclarativeServicesControl.java:4052) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at junit.framework.TestCase.runTest(TestCase.java:176) at junit.framework.TestCase.runBare(TestCase.java:141) at junit.framework.TestResult$1.protect(TestResult.java:122) at junit.framework.TestResult.runProtected(TestResult.java:142) at junit.framework.TestResult.run(TestResult.java:125) at junit.framework.TestCase.run(TestCase.java:129) at junit.framework.TestSuite.runTest(TestSuite.java:252) at junit.framework.TestSuite.run(TestSuite.java:247) at junit.framework.TestSuite.runTest(TestSuite.java:252) at junit.framework.TestSuite.run(TestSuite.java:247) at aQute.junit.Activator.test(Activator.java:340) at aQute.junit.Activator.automatic(Activator.java:236) at aQute.junit.Activator.run(Activator.java:177) at aQute.launcher.Launcher.lambda$serviceChanged$0(Launcher.java:1377) at aQute.launcher.Launcher.run(Launcher.java:349) at aQute.launcher.Launcher.main(Launcher.java:149) Caused by: java.lang.RuntimeException: failed at org.osgi.test.cases.component.junit.DS14TestCase.testCoordinationFailed(DS14TestCase.java:584) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:38) ... 8 more

Using default permissions for bundleentry://7.fwk11003494/tb23.jar

No permissions for bundleentry://7.fwk11003494/tb23.jar

activate: org.osgi.test.cases.component.tb23.MultiplePIDs[3D3BA765] activate: org.osgi.test.cases.component.tb23.TargetedPIDOptionalNoModified[5D1659EA] activate: org.osgi.test.cases.component.tb23.TargetedPIDOptionalModified[1951B871] activate: org.osgi.test.cases.component.tb23.Coordinator[33AECA0B] activate: org.osgi.test.cases.component.tb23.MultiplePIDsFactory[4BA302E0] deactivate: org.osgi.test.cases.component.tb23.MultiplePIDs[3D3BA765] deactivate: org.osgi.test.cases.component.tb23.MultiplePIDsFactory[4BA302E0] deactivate: org.osgi.test.cases.component.tb23.TargetedPIDOptionalNoModified[5D1659EA] deactivate: org.osgi.test.cases.component.tb23.TargetedPIDOptionalModified[1951B871] deactivate: org.osgi.test.cases.component.tb23.Coordinator[33AECA0B]

<< testConfigurationMultiplePIDsFactory130(org.osgi.test.cases.component.junit.DeclarativeServicesControl), fails=1, errors=0

bjhargrave commented 5 years ago

Comment author: @cziegeler

It seems this is really related to coordination and this test is failing because there is a coordination from another test hanging around which is already terminated. However, config admin is still trying to add a participant to it. FELIX-6062 is fixing this bug in config admin

bjhargrave commented 5 years ago

Comment author: @cziegeler

Fixed with rev 48c6f91895 by updating to latest Apache Felix Configadmin 1.9.12