Pax-exam runs test twice when extending base class KarafTestSupport

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Pax-exam runs test twice when extending base class KarafTestSupport

Alex Soto
Hello,

I am running Pax-exam 4.13.1. If  I extend my test class from KarafTestSupport class (from 

<dependency>
            <groupId>org.apache.karaf.itests</groupId>
            <artifactId>common</artifactId>
            <version>4.2.8</version>
        </dependency>


) then the test are being run twice by Pax-Exam.  Any idea?  

Best regards,
Alex soto




Reply | Threaded
Open this post in threaded view
|

Re: Pax-exam runs test twice when extending base class KarafTestSupport

jbonofre
It?s due to the restart in case of failure (it?s part of the Karaf test support). 

Regards 
JB

Le jeu. 13 f?vr. 2020 ? 21:26, Alex Soto <[hidden email]> a ?crit :
Hello,

I am running Pax-exam 4.13.1. If  I extend my test class from KarafTestSupport class (from 

<dependency>
            <groupId>org.apache.karaf.itests</groupId>
            <artifactId>common</artifactId>
            <version>4.2.8</version>
        </dependency>


) then the test are being run twice by Pax-Exam.  Any idea?  

Best regards,
Alex soto




Reply | Threaded
Open this post in threaded view
|

Re: Pax-exam runs test twice when extending base class KarafTestSupport

Alex Soto
Thanks JB,  do you know the exact option name or how to disable this?  

Best regards,
Alex soto




On Feb 13, 2020, at 3:37 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

It?s due to the restart in case of failure (it?s part of the Karaf test support). 

Regards 
JB

Le jeu. 13 f?vr. 2020 ? 21:26, Alex Soto <[hidden email]> a ?crit :
Hello,

I am running Pax-exam 4.13.1. If  I extend my test class from KarafTestSupport class (from 

<dependency>
            <groupId>org.apache.karaf.itests</groupId>
            <artifactId>common</artifactId>
            <version>4.2.8</version>
        </dependency>


) then the test are being run twice by Pax-Exam.  Any idea?  

Best regards,
Alex soto





Reply | Threaded
Open this post in threaded view
|

Re: Pax-exam runs test twice when extending base class KarafTestSupport

Alex Soto
I figure out what happened, when I added KarafTestSupport as a base class to my existing test class, I forgot to remove option KarafDistributionOption.karafDistributionConfiguration from the child class, so it looks like it was launching two Karaf’s instances.  When I removed this option from the child class, the problem went away, i.e., the test runs only once, as expected. 


Thanks,
Alex soto




On Feb 13, 2020, at 3:42 PM, Alex Soto <[hidden email]> wrote:

Thanks JB,  do you know the exact option name or how to disable this?  

Best regards,
Alex soto




On Feb 13, 2020, at 3:37 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

It?s due to the restart in case of failure (it?s part of the Karaf test support). 

Regards 
JB

Le jeu. 13 f?vr. 2020 ? 21:26, Alex Soto <[hidden email]> a ?crit :
Hello,

I am running Pax-exam 4.13.1. If  I extend my test class from KarafTestSupport class (from 

<dependency>
            <groupId>org.apache.karaf.itests</groupId>
            <artifactId>common</artifactId>
            <version>4.2.8</version>
        </dependency>


) then the test are being run twice by Pax-Exam.  Any idea?  

Best regards,
Alex soto






Reply | Threaded
Open this post in threaded view
|

Re: Pax-exam runs test twice when extending base class KarafTestSupport

Alex Soto
Also, I had overlooked a Retry option, which is set in KarafTestSupport :

  @Rule
    public Retry retry = new Retry(true);

Which I set to false in my test constructor:

retry = new Retry(false);


Best regards,
Alex soto




On Feb 13, 2020, at 4:03 PM, Alex Soto <[hidden email]> wrote:

I figure out what happened, when I added KarafTestSupport as a base class to my existing test class, I forgot to remove option KarafDistributionOption.karafDistributionConfiguration from the child class, so it looks like it was launching two Karaf’s instances.  When I removed this option from the child class, the problem went away, i.e., the test runs only once, as expected. 


Thanks,
Alex soto




On Feb 13, 2020, at 3:42 PM, Alex Soto <[hidden email]> wrote:

Thanks JB,  do you know the exact option name or how to disable this?  

Best regards,
Alex soto




On Feb 13, 2020, at 3:37 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

It?s due to the restart in case of failure (it?s part of the Karaf test support). 

Regards 
JB

Le jeu. 13 f?vr. 2020 ? 21:26, Alex Soto <[hidden email]> a ?crit :
Hello,

I am running Pax-exam 4.13.1. If  I extend my test class from KarafTestSupport class (from 

<dependency>
            <groupId>org.apache.karaf.itests</groupId>
            <artifactId>common</artifactId>
            <version>4.2.8</version>
        </dependency>


) then the test are being run twice by Pax-Exam.  Any idea?  

Best regards,
Alex soto