So, actually I did have the karaf dependency. 

 <dependencies>
        <dependency>
            <groupId>org.apache.karaf</groupId>
            <artifactId>apache-karaf</artifactId>
            <version>${karaf.version}</version>
            <type>zip</type>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.karaf.shell</groupId>
                    <artifactId>org.apache.karaf.shell.dev</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
....

So I changed I added the local .m2 repo to be the first in  
"etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.repositories" and also 
changed the way the karaf distribution is specified. If the actual karaf zip 
bin is available in the local M2, use that instead of the mvn format.

With these two changes it seems to have sped it up. Startup time can be between 
4-10s.

Also to clarify again, I'm creating the pax exam and container myself in my 
tests using junit's BeforeClass, AfterClass. Therefore I don't need the reactor 
strategy, using it took too long for me anyway and I'm always going to be using 
one configuration. I'm simplifying my code as an example:

        system = PaxExamRuntime.createTestSystem(getOptions());
        container = PaxExamRuntime.createContainer(system);

        container.start(); <--- used to take 20-30 seconds. now usually < 10s.

Now I have to find a way to get my other tidbits to deploy/run faster. They're 
taking another 10-15s. 

-Marcos

On Jun 17, 2013, at 5:24 AM, Christian Schneider wrote:

> Do you already use the EagerSingleStagedReactorStrategy ? See 
> https://ops4j1.jira.com/wiki/display/paxexam/Reactor+Strategies
> It does not help for the startup time but reduces the number of starts.
> 
> Christian
> 
> Am 14.06.2013 15:37 schrieb "Marcos Mendez" <[email protected]>:
> Hi,
> 
> Maven only checks the version in the build, as after the first build, that 
> zip is already in my local .m2. The time I'm quoting is the actual container 
> (start method) startup time (after creating the exam system and container). 
> That's what I'm trying to minimize. I did plan to look at the repos that I'm 
> using, to limit them to the local only - as I know what I will be installing. 
> But was wondering if there's anything else I can do.
> 
> Regards,
> Marcos
> 
> On Jun 14, 2013, at 12:44 AM, Andreas Pieber wrote:
> 
>> Do you reference the apache karaf artifact in your pom files? This is the 
>> only problem I can imagine making plain karaf tests sooooo slow for you. If 
>> you dont enter the karaf distribution in your pom file as a dependency the 
>> test framework doesnt copy it into your .m2 directory and therefore freshly 
>> download it for each test.
>> 
>> Kind regards,
>> Andreas
>> 
>> 
>> On Thu, Jun 13, 2013 at 10:36 PM, Marcos Mendez <[email protected]> wrote:
>> Hi,
>> 
>> I'm trying to improve the startup time for our integration tests. I'm using 
>> the vanilla maven distribution zip, the exam tooling, and cut down the 
>> featuresBoot to config. Is there anything else I can do to cut down the 
>> startup time? It's taking around 20-30s to start with no additional 
>> configuration. Any ideas?
>> 
>> Regards,
>> Marcos
>> 
> 

Reply via email to