You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Alex Soto <al...@envieta.com> on 2020/02/13 20:26:43 UTC

Pax-exam runs test twice when extending base class KarafTestSupport

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





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

Posted by Alex Soto <al...@envieta.com>.
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 <al...@envieta.com> 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 <alex.soto@envieta.com <ma...@envieta.com>> 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é <jb@nanthrax.net <ma...@nanthrax.net>> 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 <alex.soto@envieta.com <ma...@envieta.com>> 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
>>> 
>>> 
>>> 
>>> 
>> 
> 


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

Posted by Alex Soto <al...@envieta.com>.
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 <al...@envieta.com> 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é <jb@nanthrax.net <ma...@nanthrax.net>> 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 <alex.soto@envieta.com <ma...@envieta.com>> 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
>> 
>> 
>> 
>> 
> 


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

Posted by Alex Soto <al...@envieta.com>.
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é <jb...@nanthrax.net> 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 <al...@envieta.com> 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
> 
> 
> 
> 


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

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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 <al...@envieta.com> 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  
>  
>  
>  
>

>

>  
>