We’re using 4.1.0. It hasn’t been a problem for us until this week when we started a new round of integration test authoring.
Most of the time spent waiting seems to be after JVM start and before Karaf boots. Our plain Felix PAM Exam tests are still very fast. I’ll be back in there later today and will attach Yourkit to it and hopefully get you something more useful than “it’s slow”. -Nick From: Achim Nierbeck <[email protected]<mailto:[email protected]>> Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Date: Friday, February 13, 2015 at 10:19 AM To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Subject: Re: Integration Tests hang for approx. 30 seconds after Karaf 2.3.3 upgrade to 3.0.3 Hi, which version of Pax Exam are you using? And did you try to upgrade to the latest version of it? regards, Achim 2015-02-13 15:40 GMT+01:00 Nick Baker <[email protected]<mailto:[email protected]>>: We are experiencing the same slowdown in PAX-Exam with 3.0.0, also using TinyBundles. Pretty painful. MavenArtifactUrlReference karafUrl = maven() .groupId( "org.apache.karaf" ) .artifactId( "apache-karaf" ) .version( "3.0.0" ) .type( "tar.gz" ); ... karafDistributionConfiguration() .frameworkUrl( karafUrl ) .unpackDirectory( new File( "target/exam" ) ) .useDeployFolder( false ), On 2/13/15, 6:10 AM, "koslowskyj" <[email protected]<mailto:[email protected]>> wrote: >Hi, > >I am not sure whether this belongs on the karaf or rather on the pax >mailinglist. >After i upgraded from karaf 2.3.3 to 3.0.3 i noticed that our integration >tests slowed down dramatically (30 seconds to 1 minute per test). > >So i tried a few things, setted up a minimal test with PaxExam for >KarafContainer and added also a Tinybundle to the Test (because most of >our >tests use TinyBundles). I noticed that when i was using the same Test and >same maven settings for PaxExam with diffrent Karaf Version they were a >lot >slower on Karaf 3.0.3 (a ~30 second timeout during the Test with 3.0.3). >With Karaf 2.3.3 they behaved as expected. This only seems to happen when >using TinyBundles and Karaf 3.0.3. >Is this a bug? Does anybody know how to fix this? > >Best regards > > >2.3.3 result: > >[INFO] Total time: 24.384 s > >3.0.3 result: > >[INFO] Total time: 54.138 s > > >Test: > > >import static aQute.bnd.osgi.Constants.BUNDLE_SYMBOLICNAME; >import static aQute.bnd.osgi.Constants.EXPORT_PACKAGE; >import static aQute.bnd.osgi.Constants.IMPORT_PACKAGE; >import static junit.framework.Assert.assertTrue; >import static org.ops4j.pax.exam.CoreOptions.maven; >import static org.ops4j.pax.exam.CoreOptions.streamBundle; >import static org.ops4j.pax.tinybundles.core.TinyBundles.bundle; >import static org.osgi.framework.Constants.DYNAMICIMPORT_PACKAGE; > >import java.io.File; > >import org.junit.Test; >import org.junit.runner.RunWith; >import org.ops4j.pax.exam.Configuration; >import org.ops4j.pax.exam.CoreOptions; >import org.ops4j.pax.exam.Option; >import org.ops4j.pax.exam.junit.PaxExam; >import org.ops4j.pax.exam.karaf.options.KarafDistributionOption; >import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel; >import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; >import org.ops4j.pax.exam.spi.reactors.PerClass; >import org.ops4j.pax.tinybundles.core.TinyBundle; > >import sample.minimal.karaf.test.second.MyClass; > >@RunWith(PaxExam.class) >@ExamReactorStrategy(PerClass.class) >public class VersionAsInProjectKarafTest >{ > > @Configuration > public Option[] config() > { > return new Option[]{ > KarafDistributionOption.logLevel(LogLevel.TRACE), > >KarafDistributionOption.karafDistributionConfiguration().frameworkUrl( > >maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.g >z").versionAsInProject()) > .karafVersion("2.3.3") > // .karafVersion("3.0.3") > .name("Apache >Karaf").useDeployFolder(false).unpackDirectory(new >File("target/paxexam")), > >KarafDistributionOption.editConfigurationFileExtend("etc/config.properties >", >"org.apache.aries.blueprint.synchronous", "false"), > runtimeUtils() > }; > } > > > /** > * Sets up and provisions a bundle packaged with the runtime utitlity >classes and corresponding headers. This method > * should not be called directly as it is called from {@link >#provisionRuntimeUtilities()}. > */ > private static Option runtimeUtils() > { > > final TinyBundle tinyBundle = bundle() > .add(MyClass.class) > .set(BUNDLE_SYMBOLICNAME, >"sample.minimal.karaf.test.second") > .set(EXPORT_PACKAGE, "sample.minimal.karaf.test.second") > .set(IMPORT_PACKAGE, "*") > .set(DYNAMICIMPORT_PACKAGE, "*"); > > return CoreOptions.provision(streamBundle(tinyBundle.build())); > } > > > @Test > public void test() throws Exception > { > assertTrue(true); > } > >} > >pom.xml > > ><project xmlns="http://maven.apache.org/POM/4.0.0" >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 >http://maven.apache.org/xsd/maven-4.0.0.xsd"> > <modelVersion>4.0.0</modelVersion> > <groupId>some.test</groupId> > > <artifactId>sample.minimal.karaf.test.second</artifactId> > <version>0.0.1-SNAPSHOT</version> > <packaging>bundle</packaging> > > <dependencies> > > <dependency> > *setting for karaf 3* > / > < groupId>org.apache.karaf.features</groupId> > > <version>3.0.3</version>/ > > > *setting for karaf 2* >/ <groupId>org.apache.karaf.assemblies.features</groupId> > / > <artifactId>standard</artifactId> > > /<version>2.3.3</version>/ > > <classifier>features</classifier> > > <type>xml</type> > </dependency> > > > <dependency> > > <groupId>org.apache.karaf</groupId> > > <artifactId>apache-karaf</artifactId> > > <version>2.3.3</version> > > <type>tar.gz</type> > > <scope>test</scope> > </dependency> > > <dependency> > > <groupId> > > org.ops4j.pax.exam > > </groupId> > > <artifactId> > > pax-exam-spi > > </artifactId> > > <version>4.4.0</version> > > <scope>test</scope> > </dependency> > > <dependency> > > <groupId>org.ops4j.pax.exam</groupId> > > <artifactId>pax-exam-container-karaf</artifactId> > > <version>4.4.0</version> > > <scope>test</scope> > </dependency> > <dependency> > > <groupId>org.ops4j.pax.exam</groupId> > > <artifactId>pax-exam-junit4</artifactId> > > <version>4.4.0</version> > > <scope>test</scope> > </dependency> > <dependency> > > <groupId>org.ops4j.pax.exam</groupId> > > <artifactId>pax-exam</artifactId> > > <version>4.4.0</version> > > <scope>test</scope> > </dependency> > <dependency> > > <groupId>org.ops4j.pax.url</groupId> > > <artifactId>pax-url-aether</artifactId> > > <version>2.3.0</version> > > <scope>test</scope> > </dependency> > <dependency> > > <groupId>javax.inject</groupId> > > <artifactId>javax.inject</artifactId> > > <version>1</version> > > <scope>test</scope> > </dependency> > <dependency> > > <groupId>junit</groupId> > > <artifactId>junit</artifactId> > > <version>4.11</version> > > <scope>test</scope> > </dependency> > </dependencies> > > <build> > <plugins> > > > <plugin> > > > <artifactId>maven-compiler-plugin</artifactId> > > <version>3.1</version> > > <configuration> > > > <source>1.7</source> > > > <target>1.7</target> > > </configuration> > > </plugin> > > <plugin> > > > <groupId>org.apache.felix</groupId> > > > <artifactId>maven-bundle-plugin</artifactId> > > <extensions>true</extensions> > > <version>2.3.7</version> > > > </plugin> > > <plugin> > > > <groupId>org.apache.servicemix.tooling</groupId> > > > <artifactId>depends-maven-plugin</artifactId> > > <version>1.2</version> > > > <executions> > > > <execution> > > > <id>generate-depends-file</id> > > > <goals> > > > > <goal>generate-depends-file</goal> > > > </goals> > > > </execution> > > </executions> > > </plugin> > > <plugin> > > > <artifactId>maven-surefire-plugin</artifactId> > > <configuration> > > > <systemPropertyVariables> > ><pax.exam.karaf.version>2.3.3</pax.exam.karaf.version> > > > </systemPropertyVariables> > > </configuration> > > </plugin> > </plugins> > </build> ></project> > > > > > >-- >View this message in context: >http://karaf.922171.n3.nabble.com/Integration-Tests-hang-for-approx-30-sec >onds-after-Karaf-2-3-3-upgrade-to-3-0-3-tp4038517.html >Sent from the Karaf - User mailing list archive at Nabble.com. -- Apache Member Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead blog <http://notizblog.nierbeck.de/> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS> Software Architect / Project Manager / Scrum Master
