So I checked the status of the bundles after a failure, and some of the
bundles are not in 'active' state, even though the sling testing tools said:
512 [Test worker] INFO
org.apache.sling.testing.tools.osgi.WebconsoleClient - Installing bundle
org.apache.sling.junit.core-1.0.8.jar at default start level
745 [Test worker] INFO
org.apache.sling.testing.tools.osgi.WebconsoleClient - Installing bundle
org.apache.sling.junit.scriptable-1.0.8.jar at default start level
755 [Test worker] INFO
org.apache.sling.testing.tools.osgi.WebconsoleClient - Installing bundle
org.apache.sling.junit.remote-1.0.9-SNAPSHOT.jar at default start level
766 [Test worker] INFO
org.apache.sling.testing.tools.osgi.WebconsoleClient - Installing bundle
org.apache.sling.testing.tools-1.0.7-SNAPSHOT.jar at default start level
778 [Test worker] INFO
org.apache.sling.testing.tools.osgi.WebconsoleClient - Installing bundle
httpclient-osgi-4.1.2.jar at default start level
806 [Test worker] INFO
org.apache.sling.testing.tools.osgi.WebconsoleClient - Installing bundle
httpcore-osgi-4.1.2.jar at default start level
827 [Test worker] INFO
org.apache.sling.testing.tools.osgi.WebconsoleClient - Installing bundle
wcm-platform-test-sling-junit-example-1.0-SNAPSHOT.jar at default start
level
837 [Test worker] INFO
org.apache.sling.testing.tools.sling.BundlesInstaller - 7 additional bundles
installed from
C:\workspace-ggts\wcm-platform-test-sling-junit-example\build\sling\additional-bundles\org.apache.sling.junit.core-1.0.8.jar
840 [Test worker] INFO
org.apache.sling.testing.tools.sling.BundlesInstaller - Checking that
bundles are installed (timeout 20 seconds): [org.apache.sling.junit.core,
org.apache.sling.junit.scriptable, org.apache.sling.junit.remote,
org.apache.sling.testing.tools, org.apache.httpcomponents.httpclient,
org.apache.httpcomponents.httpcore,
com.snidigital.wcm.platform.test.wcm-platform-test-sling-junit-example]
938 [Test worker] INFO
org.apache.sling.testing.tools.sling.BundlesInstaller - Starting bundles
(timeout 30 seconds): [org.apache.sling.junit.core,
org.apache.sling.junit.scriptable, org.apache.sling.junit.remote,
org.apache.sling.testing.tools, org.apache.httpcomponents.httpclient,
org.apache.httpcomponents.httpcore,
com.snidigital.wcm.platform.test.wcm-platform-test-sling-junit-example]
1058 [Test worker] INFO
org.apache.sling.testing.tools.sling.BundlesInstaller - Ok - all bundles are
in the active state
After a failure, if I activate the bundles from the OSGi console and run the
test again, it succeeds.
So, could it be that the bundles are being checked if they're active before
the OSGi environment has had time to update the status from them being
installed?
--
View this message in context:
http://apache-sling.73963.n3.nabble.com/Subsequent-runs-of-the-same-tests-fail-if-OSGi-environment-not-restarted-tp4032920p4032930.html
Sent from the Sling - Users mailing list archive at Nabble.com.