You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Christian Schneider <ch...@die-schneider.net> on 2012/09/19 13:07:17 UTC

Problems running itests on windows in eclipse

I saw some failures in the itests on trunk when running from maven. So I 
tried to import the project into eclipse and run the tests from there to 
debug into them.

The problem is that the tests do not even seem to fully start on 
eclipse. They seem to hang inside:
org.ops4j.pax.exam.spi.intern.TestProbeBuilderImpl.selectCollector(File)

I then found that the itests/target dir is about 2GB big. As far as I 
could debug it seems that the tests do not fully hang and instead seem 
to go through each of those many files and so never seem to start.

So the questions are:
Does anyone alse see this behaviour?
Can we change this so the tests take less file space? On windows it 
takes even several minutes to just delete the target dir after the tests.

Christian

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: Problems running itests on windows in eclipse

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
It's possible using config on KarafDistributionOption:

- each test can share the same unpack directory: 
KarafDistributionBaseConfigurationOption.unpackDirectory
- the runtime directories are cleanup after exec if we don't use the 
KeepRuntimeFolderOption option

Regards
JB

On 09/19/2012 03:57 PM, Daniel Kulp wrote:
>
> If a test passes, shouldn't it also completely clean up after itself?    I personally hate things that leave leftover crap all over the place when things have gone well.   For failed tests, sure, leave things around to help debug, but for passing tests, clean up.
>
>
> Dan
>
>
>
> On Sep 19, 2012, at 7:33 AM, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>
>> I always do mvn clean install or mvn clean test.
>>
>> For the target/karaf dir, karaf-pax-exam completly bootstrap a Karaf instance for each test. IMHO, it's a good approach because each test is atomic. If the user want to create only one Karaf instance bootstrap, it can gather all asserts in one method.
>>
>> Regards
>> JB
>>
>> On 09/19/2012 01:22 PM, Christian Schneider wrote:
>>> I now got the itests running. The key is to delete the target dir before
>>> the test.
>>> After I ran one test class the target dir had 80 MB. I think the reason
>>> why it now worked is that windows can cope with this size.
>>>
>>> Still I think it does not make sense that we create a complete karaf dir
>>> for each test method and then even keep the data after the test.
>>> Can´t we optimize this in some way?
>>>
>>> Christian
>>>
>>> Am 19.09.2012 13:07, schrieb Christian Schneider:
>>>> I saw some failures in the itests on trunk when running from maven. So
>>>> I tried to import the project into eclipse and run the tests from
>>>> there to debug into them.
>>>>
>>>> The problem is that the tests do not even seem to fully start on
>>>> eclipse. They seem to hang inside:
>>>> org.ops4j.pax.exam.spi.intern.TestProbeBuilderImpl.selectCollector(File)
>>>>
>>>> I then found that the itests/target dir is about 2GB big. As far as I
>>>> could debug it seems that the tests do not fully hang and instead seem
>>>> to go through each of those many files and so never seem to start.
>>>>
>>>> So the questions are:
>>>> Does anyone alse see this behaviour?
>>>> Can we change this so the tests take less file space? On windows it
>>>> takes even several minutes to just delete the target dir after the tests.
>>>>
>>>> Christian
>>>>
>>>
>>>
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Problems running itests on windows in eclipse

Posted by Daniel Kulp <dk...@apache.org>.
If a test passes, shouldn't it also completely clean up after itself?    I personally hate things that leave leftover crap all over the place when things have gone well.   For failed tests, sure, leave things around to help debug, but for passing tests, clean up.


Dan



On Sep 19, 2012, at 7:33 AM, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:

> I always do mvn clean install or mvn clean test.
> 
> For the target/karaf dir, karaf-pax-exam completly bootstrap a Karaf instance for each test. IMHO, it's a good approach because each test is atomic. If the user want to create only one Karaf instance bootstrap, it can gather all asserts in one method.
> 
> Regards
> JB
> 
> On 09/19/2012 01:22 PM, Christian Schneider wrote:
>> I now got the itests running. The key is to delete the target dir before
>> the test.
>> After I ran one test class the target dir had 80 MB. I think the reason
>> why it now worked is that windows can cope with this size.
>> 
>> Still I think it does not make sense that we create a complete karaf dir
>> for each test method and then even keep the data after the test.
>> Can´t we optimize this in some way?
>> 
>> Christian
>> 
>> Am 19.09.2012 13:07, schrieb Christian Schneider:
>>> I saw some failures in the itests on trunk when running from maven. So
>>> I tried to import the project into eclipse and run the tests from
>>> there to debug into them.
>>> 
>>> The problem is that the tests do not even seem to fully start on
>>> eclipse. They seem to hang inside:
>>> org.ops4j.pax.exam.spi.intern.TestProbeBuilderImpl.selectCollector(File)
>>> 
>>> I then found that the itests/target dir is about 2GB big. As far as I
>>> could debug it seems that the tests do not fully hang and instead seem
>>> to go through each of those many files and so never seem to start.
>>> 
>>> So the questions are:
>>> Does anyone alse see this behaviour?
>>> Can we change this so the tests take less file space? On windows it
>>> takes even several minutes to just delete the target dir after the tests.
>>> 
>>> Christian
>>> 
>> 
>> 
> 
> -- 
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: Problems running itests on windows in eclipse

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
I always do mvn clean install or mvn clean test.

For the target/karaf dir, karaf-pax-exam completly bootstrap a Karaf 
instance for each test. IMHO, it's a good approach because each test is 
atomic. If the user want to create only one Karaf instance bootstrap, it 
can gather all asserts in one method.

Regards
JB

On 09/19/2012 01:22 PM, Christian Schneider wrote:
> I now got the itests running. The key is to delete the target dir before
> the test.
> After I ran one test class the target dir had 80 MB. I think the reason
> why it now worked is that windows can cope with this size.
>
> Still I think it does not make sense that we create a complete karaf dir
> for each test method and then even keep the data after the test.
> Can´t we optimize this in some way?
>
> Christian
>
> Am 19.09.2012 13:07, schrieb Christian Schneider:
>> I saw some failures in the itests on trunk when running from maven. So
>> I tried to import the project into eclipse and run the tests from
>> there to debug into them.
>>
>> The problem is that the tests do not even seem to fully start on
>> eclipse. They seem to hang inside:
>> org.ops4j.pax.exam.spi.intern.TestProbeBuilderImpl.selectCollector(File)
>>
>> I then found that the itests/target dir is about 2GB big. As far as I
>> could debug it seems that the tests do not fully hang and instead seem
>> to go through each of those many files and so never seem to start.
>>
>> So the questions are:
>> Does anyone alse see this behaviour?
>> Can we change this so the tests take less file space? On windows it
>> takes even several minutes to just delete the target dir after the tests.
>>
>> Christian
>>
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Problems running itests on windows in eclipse

Posted by Christian Schneider <ch...@die-schneider.net>.
In theory you are right but as the lib and system dirs are thought to be 
read only this should not be an issue in practice.

Christian

Am 19.09.2012 14:25, schrieb Jean-Baptiste Onofré:
> I don't think it's a good idea as the tests won't be atomic.
>
> As a Maven test user, I expect that each @Test is completely isolated 
> from another and can not be polluted by another one.
>
> If two @Test methods should share resources, it's the purpose of 
> @Before (executed before each @Test) and use a dedicated annotation.
>
> Regards
> JB

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: Problems running itests on windows in eclipse

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
I don't think it's a good idea as the tests won't be atomic.

As a Maven test user, I expect that each @Test is completely isolated 
from another and can not be polluted by another one.

If two @Test methods should share resources, it's the purpose of @Before 
(executed before each @Test) and use a dedicated annotation.

Regards
JB

On 09/19/2012 02:20 PM, Christian Schneider wrote:
> How about doing the same as for a karaf instance. We could share system
> and lib for all tests. That should make the space needed for each
> instance much smaller.
>
> Christian
>
> Am 19.09.2012 13:38, schrieb Jean-Baptiste Onofré:
>> Maybe introducing an annotation (@Inject or so) on the method to reuse
>> an existing bootstrap dir could be interesting.
>>
>> Regards
>> JB
>>
>> On 09/19/2012 01:22 PM, Christian Schneider wrote:
>>> I now got the itests running. The key is to delete the target dir before
>>> the test.
>>> After I ran one test class the target dir had 80 MB. I think the reason
>>> why it now worked is that windows can cope with this size.
>>>
>>> Still I think it does not make sense that we create a complete karaf dir
>>> for each test method and then even keep the data after the test.
>>> Can´t we optimize this in some way?
>>>
>>> Christian
>>>
>>> Am 19.09.2012 13:07, schrieb Christian Schneider:
>>>> I saw some failures in the itests on trunk when running from maven. So
>>>> I tried to import the project into eclipse and run the tests from
>>>> there to debug into them.
>>>>
>>>> The problem is that the tests do not even seem to fully start on
>>>> eclipse. They seem to hang inside:
>>>> org.ops4j.pax.exam.spi.intern.TestProbeBuilderImpl.selectCollector(File)
>>>>
>>>>
>>>> I then found that the itests/target dir is about 2GB big. As far as I
>>>> could debug it seems that the tests do not fully hang and instead seem
>>>> to go through each of those many files and so never seem to start.
>>>>
>>>> So the questions are:
>>>> Does anyone alse see this behaviour?
>>>> Can we change this so the tests take less file space? On windows it
>>>> takes even several minutes to just delete the target dir after the
>>>> tests.
>>>>
>>>> Christian
>>>>
>>>
>>>
>>
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Problems running itests on windows in eclipse

Posted by Achim Nierbeck <bc...@googlemail.com>.
But isn't an iTest (as Integration Test) since it does alter the test setup ...

2012/9/19 Christian Schneider <ch...@die-schneider.net>:
> How about doing the same as for a karaf instance. We could share system and
> lib for all tests. That should make the space needed for each instance much
> smaller.
>
> Christian
>
> Am 19.09.2012 13:38, schrieb Jean-Baptiste Onofré:
>
>> Maybe introducing an annotation (@Inject or so) on the method to reuse an
>> existing bootstrap dir could be interesting.
>>
>> Regards
>> JB
>>
>> On 09/19/2012 01:22 PM, Christian Schneider wrote:
>>>
>>> I now got the itests running. The key is to delete the target dir before
>>> the test.
>>> After I ran one test class the target dir had 80 MB. I think the reason
>>> why it now worked is that windows can cope with this size.
>>>
>>> Still I think it does not make sense that we create a complete karaf dir
>>> for each test method and then even keep the data after the test.
>>> Can´t we optimize this in some way?
>>>
>>> Christian
>>>
>>> Am 19.09.2012 13:07, schrieb Christian Schneider:
>>>>
>>>> I saw some failures in the itests on trunk when running from maven. So
>>>> I tried to import the project into eclipse and run the tests from
>>>> there to debug into them.
>>>>
>>>> The problem is that the tests do not even seem to fully start on
>>>> eclipse. They seem to hang inside:
>>>> org.ops4j.pax.exam.spi.intern.TestProbeBuilderImpl.selectCollector(File)
>>>>
>>>> I then found that the itests/target dir is about 2GB big. As far as I
>>>> could debug it seems that the tests do not fully hang and instead seem
>>>> to go through each of those many files and so never seem to start.
>>>>
>>>> So the questions are:
>>>> Does anyone alse see this behaviour?
>>>> Can we change this so the tests take less file space? On windows it
>>>> takes even several minutes to just delete the target dir after the
>>>> tests.
>>>>
>>>> Christian
>>>>
>>>
>>>
>>
>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> Talend Application Integration Division http://www.talend.com
>



-- 

Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
Committer & Project Lead
OPS4J Pax for Vaadin
<http://team.ops4j.org/wiki/display/PAXVAADIN/Home> Commiter & Project
Lead
blog <http://notizblog.nierbeck.de/>

Re: Problems running itests on windows in eclipse

Posted by Christian Schneider <ch...@die-schneider.net>.
How about doing the same as for a karaf instance. We could share system 
and lib for all tests. That should make the space needed for each 
instance much smaller.

Christian

Am 19.09.2012 13:38, schrieb Jean-Baptiste Onofré:
> Maybe introducing an annotation (@Inject or so) on the method to reuse 
> an existing bootstrap dir could be interesting.
>
> Regards
> JB
>
> On 09/19/2012 01:22 PM, Christian Schneider wrote:
>> I now got the itests running. The key is to delete the target dir before
>> the test.
>> After I ran one test class the target dir had 80 MB. I think the reason
>> why it now worked is that windows can cope with this size.
>>
>> Still I think it does not make sense that we create a complete karaf dir
>> for each test method and then even keep the data after the test.
>> Can´t we optimize this in some way?
>>
>> Christian
>>
>> Am 19.09.2012 13:07, schrieb Christian Schneider:
>>> I saw some failures in the itests on trunk when running from maven. So
>>> I tried to import the project into eclipse and run the tests from
>>> there to debug into them.
>>>
>>> The problem is that the tests do not even seem to fully start on
>>> eclipse. They seem to hang inside:
>>> org.ops4j.pax.exam.spi.intern.TestProbeBuilderImpl.selectCollector(File) 
>>>
>>>
>>> I then found that the itests/target dir is about 2GB big. As far as I
>>> could debug it seems that the tests do not fully hang and instead seem
>>> to go through each of those many files and so never seem to start.
>>>
>>> So the questions are:
>>> Does anyone alse see this behaviour?
>>> Can we change this so the tests take less file space? On windows it
>>> takes even several minutes to just delete the target dir after the 
>>> tests.
>>>
>>> Christian
>>>
>>
>>
>


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: Problems running itests on windows in eclipse

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Maybe introducing an annotation (@Inject or so) on the method to reuse 
an existing bootstrap dir could be interesting.

Regards
JB

On 09/19/2012 01:22 PM, Christian Schneider wrote:
> I now got the itests running. The key is to delete the target dir before
> the test.
> After I ran one test class the target dir had 80 MB. I think the reason
> why it now worked is that windows can cope with this size.
>
> Still I think it does not make sense that we create a complete karaf dir
> for each test method and then even keep the data after the test.
> Can´t we optimize this in some way?
>
> Christian
>
> Am 19.09.2012 13:07, schrieb Christian Schneider:
>> I saw some failures in the itests on trunk when running from maven. So
>> I tried to import the project into eclipse and run the tests from
>> there to debug into them.
>>
>> The problem is that the tests do not even seem to fully start on
>> eclipse. They seem to hang inside:
>> org.ops4j.pax.exam.spi.intern.TestProbeBuilderImpl.selectCollector(File)
>>
>> I then found that the itests/target dir is about 2GB big. As far as I
>> could debug it seems that the tests do not fully hang and instead seem
>> to go through each of those many files and so never seem to start.
>>
>> So the questions are:
>> Does anyone alse see this behaviour?
>> Can we change this so the tests take less file space? On windows it
>> takes even several minutes to just delete the target dir after the tests.
>>
>> Christian
>>
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Problems running itests on windows in eclipse

Posted by Christian Schneider <ch...@die-schneider.net>.
I now got the itests running. The key is to delete the target dir before 
the test.
After I ran one test class the target dir had 80 MB. I think the reason 
why it now worked is that windows can cope with this size.

Still I think it does not make sense that we create a complete karaf dir 
for each test method and then even keep the data after the test.
Can´t we optimize this in some way?

Christian

Am 19.09.2012 13:07, schrieb Christian Schneider:
> I saw some failures in the itests on trunk when running from maven. So
> I tried to import the project into eclipse and run the tests from
> there to debug into them.
>
> The problem is that the tests do not even seem to fully start on
> eclipse. They seem to hang inside:
> org.ops4j.pax.exam.spi.intern.TestProbeBuilderImpl.selectCollector(File)
>
> I then found that the itests/target dir is about 2GB big. As far as I
> could debug it seems that the tests do not fully hang and instead seem
> to go through each of those many files and so never seem to start.
>
> So the questions are:
> Does anyone alse see this behaviour?
> Can we change this so the tests take less file space? On windows it
> takes even several minutes to just delete the target dir after the tests.
>
> Christian
>


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com