You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@archiva.apache.org by Eric Barboni <sk...@apache.org> on 2020/02/14 00:09:55 UTC

RE: Test fails( on Windows)

Hi, 
 Jumping late in the conversation for the failing test on windows.
 
-- 
 I did a bit of cleanup + test modification to get archiva-common and archiva-checksum
See the PR  https://github.com/apache/archiva/pull/57 as I prefer a review to be sure everything is semantically correct.

--
I have big issue with archiva-filelock  with the multithread test 
on windows:  partial lock ..   
on wsl (linux on windows): file not found.

My java wsl is openjdk 8_232

I see that our build are ok on Jenkins. (sic) remembers me old story ... :D
  
Best Regards
Eric

-----Message d'origine-----
De : Martin Stockhammer <ma...@apache.org> 
Envoyé : mardi 1 octobre 2019 22:51
À : dev@archiva.apache.org; strasser999@gmail.com
Objet : Re: Test fails on Windows

Hi Joel,

the master branch in the current state was never built on Windows.
Jenkins is on Linux and I'm developing on Linux and Olivier too I think.
This seems to be related to some windows specifics. If you like, you can check the code and try to find a solution. If you rather like to have a working build in the first place, you may switch to Linux.

Sometimes it's easy to get lost in the archiva codebase. If you need some hints where to search, ping me.

Regards

Martin

Am 1. Oktober 2019 21:29:57 MESZ schrieb strasser999@gmail.com:
>Hi,
>
>I couldn't build the master branch onWindows. Following errors
>occoured:
>
>testToRelativeWithoutSlash(org.apache.archiva.common.utils.PathUtilTest
>)
>Time elapsed: 0.001 s <<< FAILURE!
>junit.framework.ComparisonFailure: expected:<path[/to/]resource.xml> 
>but was:<path[to]resource.xml> at
>org.apache.archiva.common.utils.PathUtilTest.testToRelativeWithoutSlash
>(PathUtilTest.java:38)
>
>testToRelativeWithSlash(org.apache.archiva.common.utils.PathUtilTest)
>Time elapsed: 0 s <<< FAILURE!
>junit.framework.ComparisonFailure: expected:<path[/to/]resource.xml> 
>but was:<path[to]resource.xml> at
>org.apache.archiva.common.utils.PathUtilTest.testToRelativeWithSlash(Pa
>thUtilTest.java:44)
>
>Should I consider building on Linux instead?
>
>Best regards,
>Joel Strasser

--
This message was sent from mobile phone.


Re: Test fails( on Windows)

Posted by Martin <ma...@apache.org>.
Hi Eric,

yes, I know. The situation is different for the running archiva server, index files normally will not be removed immediately
after creating them. But you are right, it may cause problems for the running archiva. We have to test this. 
Normally this should be captured by the integration tests. But these are another topic. They are not in a usable
state at the time. I will focus on them, when the refactoring is finished.

Regards

Martin

Am Donnerstag, 27. Februar 2020, 11:41:19 CET schrieb Eric Barboni:
> Hi,
> 
> Sorry a bit busy but , I will try to apply this fix on the test failing that way.
> 
> Will help to build on windows but may not be sure to run archiva on windows if such error occurs
> 
> Regards
> 
> Eric
> 
> -----Message d'origine-----
> De : Martin Stockhammer <ma...@apache.org> 
> Envoyé : mardi 25 février 2020 21:54
> À : dev@archiva.apache.org
> Objet : Re: Test fails( on Windows)
> 
> Hi Eric,
> 
> the maven indexer or lucene writer/searcher is still accessing the index files, even if the maven indexing context is closed. Getting to the real cause is really difficult, because our maven indexer is using a shadowed lucene version.
> In the end I fixed the tests by using a unique index directory for each test.
> I think several failed tests on windows are caused by the open index files, but I don't have a better solution than using unique directories for these tests.
> 
> 
> 
> Regards
> 
> Martin
> 
> 
> 
> 
> On 24.02.20 18:01, Martin Stockhammer wrote:
> > Hi Eric,
> > 
> > the maven indexer uses the indexer classes from the maven libraries 
> > and I'm not sure, if the access to the index folder can be properly closed.
> > Maybe a unique index directory for each test can help to fix this, or 
> > as you mentioned a repo copy for each test (but this may slow down our build).
> > 
> > Let me have a look at this class. I will try out some changes.
> > 
> > Regards
> > 
> > Martin
> > 
> > On 21.02.20 11:44, Eric Barboni wrote:
> >> Hi,
> >>
> >>
> >> For example in archiva-maven-indexer
> >>
> >>
> >> MavenIndexManagerTest cannot delete recursive using archiva fileutils. 
> >> Accesdenied seems to be the root cause.
> >>
> >>
> >> Error during recursive delete of
> >> E:\jj\workspace\a\archiva-modules\archiva-maven\archiva-maven-indexer
> >> \target\repositories\test-repo\.index-test
> >>
> >>
> >>
> >> Maybe insuring each test on his own repo can be a solution
> >>
> >>
> >> Best Regards
> >>
> >> Eric
> >>
> >>
> >>
> >>
> >> De : Martin Stockhammer <ma...@apache.org> Envoyé : jeudi 20 
> >> février 2020 17:58 À : dev@archiva.apache.org; Eric Barboni 
> >> <sk...@apache.org> Objet : RE: Test fails( on Windows)
> >>
> >>
> >> Hi Eric,
> >>
> >> do the filelock related fails only occur in the filelock module, or 
> >> do they occur in other modules too?
> >> If the former, we should focus on the deletion issues. File locking 
> >> on Windows is always good for headaches :-/ and we should keep them 
> >> for later.
> >>
> >> About file deletion fails:
> >> Do you have examples? I think we should use our
> >> FileUtils.deleteQuietly() for deletion in all unit tests. And maybe 
> >> improve the util method as necessary (add a delete on vm shutdown)
> >>
> >> If file deletion in production methods does not work, I need concrete 
> >> examples. My windows system here is very limited. I can only use it 
> >> for simple test cases, no chance to build the whole archiva stack on it.
> >>
> >> Thank you and regards
> >>
> >> Martin
> >>
> >>
> >>
> >>
> >>
> >>
> >> Am 20. Februar 2020 14:47:45 MEZ schrieb Eric Barboni < 
> >> <ma...@apache.org> skygo@apache.org>:
> >>
> >> Hi Martin,
> >>   Others test issues are more difficult to handle (about 350).
> >>
> >>    Deletion is almost impossible due to access denied, still locked file.
> >> The stress test is failing a lot of time
> >>   
> >> org.apache.archiva.common.filelock.DefaultFileLockManagerTest.testWri
> >> te
> >>   
> >> org.apache.archiva.common.filelock.DefaultFileLockManager.writeFileLo
> >> ck(DefaultFileLockManager.java:222)
> >>
> >>   cannot access to file, used by another processus
> >>
> >> Regards
> >> Eric
> >>
> >> -----Message d'origine-----
> >> De : Martin Stockhammer < <ma...@apache.org> 
> >> martin_s@apache.org> Envoyé : vendredi 14 février 2020 08:37 À :  
> >> <ma...@archiva.apache.org> dev@archiva.apache.org Objet : Re: 
> >> Test fails( on Windows)
> >>
> >> Hi Eric,
> >>
> >> sorry, I missed your last mail about the filelock issue. I will check 
> >> the PR today.
> >>
> >> Regards
> >>
> >> Martin
> >>
> >> On 14.02.20 01:09, Eric Barboni wrote:
> >>
> >> Hi,
> >>    Jumping late in the conversation for the failing test on windows.
> >>
> >>
> >>
> 
> 
> 





RE: Test fails( on Windows)

Posted by Eric Barboni <sk...@apache.org>.
Hi,

Sorry a bit busy but , I will try to apply this fix on the test failing that way.

Will help to build on windows but may not be sure to run archiva on windows if such error occurs

Regards

Eric

-----Message d'origine-----
De : Martin Stockhammer <ma...@apache.org> 
Envoyé : mardi 25 février 2020 21:54
À : dev@archiva.apache.org
Objet : Re: Test fails( on Windows)

Hi Eric,

the maven indexer or lucene writer/searcher is still accessing the index files, even if the maven indexing context is closed. Getting to the real cause is really difficult, because our maven indexer is using a shadowed lucene version.
In the end I fixed the tests by using a unique index directory for each test.
I think several failed tests on windows are caused by the open index files, but I don't have a better solution than using unique directories for these tests.



Regards

Martin




On 24.02.20 18:01, Martin Stockhammer wrote:
> Hi Eric,
> 
> the maven indexer uses the indexer classes from the maven libraries 
> and I'm not sure, if the access to the index folder can be properly closed.
> Maybe a unique index directory for each test can help to fix this, or 
> as you mentioned a repo copy for each test (but this may slow down our build).
> 
> Let me have a look at this class. I will try out some changes.
> 
> Regards
> 
> Martin
> 
> On 21.02.20 11:44, Eric Barboni wrote:
>> Hi,
>>
>>
>> For example in archiva-maven-indexer
>>
>>
>> MavenIndexManagerTest cannot delete recursive using archiva fileutils. 
>> Accesdenied seems to be the root cause.
>>
>>
>> Error during recursive delete of
>> E:\jj\workspace\a\archiva-modules\archiva-maven\archiva-maven-indexer
>> \target\repositories\test-repo\.index-test
>>
>>
>>
>> Maybe insuring each test on his own repo can be a solution
>>
>>
>> Best Regards
>>
>> Eric
>>
>>
>>
>>
>> De : Martin Stockhammer <ma...@apache.org> Envoyé : jeudi 20 
>> février 2020 17:58 À : dev@archiva.apache.org; Eric Barboni 
>> <sk...@apache.org> Objet : RE: Test fails( on Windows)
>>
>>
>> Hi Eric,
>>
>> do the filelock related fails only occur in the filelock module, or 
>> do they occur in other modules too?
>> If the former, we should focus on the deletion issues. File locking 
>> on Windows is always good for headaches :-/ and we should keep them 
>> for later.
>>
>> About file deletion fails:
>> Do you have examples? I think we should use our
>> FileUtils.deleteQuietly() for deletion in all unit tests. And maybe 
>> improve the util method as necessary (add a delete on vm shutdown)
>>
>> If file deletion in production methods does not work, I need concrete 
>> examples. My windows system here is very limited. I can only use it 
>> for simple test cases, no chance to build the whole archiva stack on it.
>>
>> Thank you and regards
>>
>> Martin
>>
>>
>>
>>
>>
>>
>> Am 20. Februar 2020 14:47:45 MEZ schrieb Eric Barboni < 
>> <ma...@apache.org> skygo@apache.org>:
>>
>> Hi Martin,
>>   Others test issues are more difficult to handle (about 350).
>>
>>    Deletion is almost impossible due to access denied, still locked file.
>> The stress test is failing a lot of time
>>   
>> org.apache.archiva.common.filelock.DefaultFileLockManagerTest.testWri
>> te
>>   
>> org.apache.archiva.common.filelock.DefaultFileLockManager.writeFileLo
>> ck(DefaultFileLockManager.java:222)
>>
>>   cannot access to file, used by another processus
>>
>> Regards
>> Eric
>>
>> -----Message d'origine-----
>> De : Martin Stockhammer < <ma...@apache.org> 
>> martin_s@apache.org> Envoyé : vendredi 14 février 2020 08:37 À :  
>> <ma...@archiva.apache.org> dev@archiva.apache.org Objet : Re: 
>> Test fails( on Windows)
>>
>> Hi Eric,
>>
>> sorry, I missed your last mail about the filelock issue. I will check 
>> the PR today.
>>
>> Regards
>>
>> Martin
>>
>> On 14.02.20 01:09, Eric Barboni wrote:
>>
>> Hi,
>>    Jumping late in the conversation for the failing test on windows.
>>
>>
>>


Re: Test fails( on Windows)

Posted by Martin Stockhammer <ma...@apache.org>.
Hi Eric,

the maven indexer or lucene writer/searcher is still accessing the index 
files, even if the maven indexing context is closed. Getting to the real 
cause is really difficult, because our maven indexer is using a shadowed 
lucene version.
In the end I fixed the tests by using a unique index directory for each 
test.
I think several failed tests on windows are caused by the open index 
files, but I don't have a better solution than using unique directories
for these tests.



Regards

Martin




On 24.02.20 18:01, Martin Stockhammer wrote:
> Hi Eric,
> 
> the maven indexer uses the indexer classes from the maven libraries and 
> I'm not sure, if the access to the index folder can be properly closed. 
> Maybe a unique index directory for each test can help to fix this, or as 
> you mentioned a repo copy for each test (but this may slow down our build).
> 
> Let me have a look at this class. I will try out some changes.
> 
> Regards
> 
> Martin
> 
> On 21.02.20 11:44, Eric Barboni wrote:
>> Hi,
>>
>>
>> For example in archiva-maven-indexer
>>
>>
>> MavenIndexManagerTest cannot delete recursive using archiva fileutils. 
>> Accesdenied seems to be the root cause.
>>
>>
>> Error during recursive delete of 
>> E:\jj\workspace\a\archiva-modules\archiva-maven\archiva-maven-indexer\target\repositories\test-repo\.index-test 
>>
>>
>>
>> Maybe insuring each test on his own repo can be a solution
>>
>>
>> Best Regards
>>
>> Eric
>>
>>
>>
>>
>> De : Martin Stockhammer <ma...@apache.org>
>> Envoyé : jeudi 20 février 2020 17:58
>> À : dev@archiva.apache.org; Eric Barboni <sk...@apache.org>
>> Objet : RE: Test fails( on Windows)
>>
>>
>> Hi Eric,
>>
>> do the filelock related fails only occur in the filelock module, or do 
>> they occur in other modules too?
>> If the former, we should focus on the deletion issues. File locking on 
>> Windows is always good for headaches :-/ and we should keep them for 
>> later.
>>
>> About file deletion fails:
>> Do you have examples? I think we should use our 
>> FileUtils.deleteQuietly() for deletion in all unit tests. And maybe 
>> improve the util method as necessary (add a delete on vm shutdown)
>>
>> If file deletion in production methods does not work, I need concrete 
>> examples. My windows system here is very limited. I can only use it 
>> for simple test cases, no chance to build the whole archiva stack on it.
>>
>> Thank you and regards
>>
>> Martin
>>
>>
>>
>>
>>
>>
>> Am 20. Februar 2020 14:47:45 MEZ schrieb Eric Barboni < 
>> <ma...@apache.org> skygo@apache.org>:
>>
>> Hi Martin,
>>   Others test issues are more difficult to handle (about 350).
>>
>>    Deletion is almost impossible due to access denied, still locked file.
>> The stress test is failing a lot of time
>>   org.apache.archiva.common.filelock.DefaultFileLockManagerTest.testWrite
>>   
>> org.apache.archiva.common.filelock.DefaultFileLockManager.writeFileLock(DefaultFileLockManager.java:222) 
>>
>>   cannot access to file, used by another processus
>>
>> Regards
>> Eric
>>
>> -----Message d'origine-----
>> De : Martin Stockhammer < <ma...@apache.org> 
>> martin_s@apache.org>
>> Envoyé : vendredi 14 février 2020 08:37
>> À :  <ma...@archiva.apache.org> dev@archiva.apache.org
>> Objet : Re: Test fails( on Windows)
>>
>> Hi Eric,
>>
>> sorry, I missed your last mail about the filelock issue. I will check 
>> the PR today.
>>
>> Regards
>>
>> Martin
>>
>> On 14.02.20 01:09, Eric Barboni wrote:
>>
>> Hi,
>>    Jumping late in the conversation for the failing test on windows.
>>
>>
>>

Re: Test fails( on Windows)

Posted by Martin Stockhammer <ma...@apache.org>.
Hi Eric,

the maven indexer uses the indexer classes from the maven libraries and 
I'm not sure, if the access to the index folder can be properly closed. 
Maybe a unique index directory for each test can help to fix this, or as 
you mentioned a repo copy for each test (but this may slow down our build).

Let me have a look at this class. I will try out some changes.

Regards

Martin

On 21.02.20 11:44, Eric Barboni wrote:
> Hi,
> 
>   
> 
> For example in archiva-maven-indexer
> 
>   
> 
> MavenIndexManagerTest cannot delete recursive using archiva fileutils. Accesdenied seems to be the root cause.
> 
>   
> 
> Error during recursive delete of E:\jj\workspace\a\archiva-modules\archiva-maven\archiva-maven-indexer\target\repositories\test-repo\.index-test
> 
>   
> 
> Maybe insuring each test on his own repo can be a solution
> 
>   
> 
> Best Regards
> 
> Eric
> 
>   
> 
>   
> 
>   
> 
> De : Martin Stockhammer <ma...@apache.org>
> Envoyé : jeudi 20 février 2020 17:58
> À : dev@archiva.apache.org; Eric Barboni <sk...@apache.org>
> Objet : RE: Test fails( on Windows)
> 
>   
> 
> Hi Eric,
> 
> do the filelock related fails only occur in the filelock module, or do they occur in other modules too?
> If the former, we should focus on the deletion issues. File locking on Windows is always good for headaches :-/ and we should keep them for later.
> 
> About file deletion fails:
> Do you have examples? I think we should use our FileUtils.deleteQuietly() for deletion in all unit tests. And maybe improve the util method as necessary (add a delete on vm shutdown)
> 
> If file deletion in production methods does not work, I need concrete examples. My windows system here is very limited. I can only use it for simple test cases, no chance to build the whole archiva stack on it.
> 
> Thank you and regards
> 
> Martin
> 
> 
> 
> 
> 
> 
> Am 20. Februar 2020 14:47:45 MEZ schrieb Eric Barboni < <ma...@apache.org> skygo@apache.org>:
> 
> Hi Martin,
>   Others test issues are more difficult to handle (about 350).
> 
>    Deletion is almost impossible due to access denied, still locked file.
>   
> The stress test is failing a lot of time
>   org.apache.archiva.common.filelock.DefaultFileLockManagerTest.testWrite
>   org.apache.archiva.common.filelock.DefaultFileLockManager.writeFileLock(DefaultFileLockManager.java:222)
>   cannot access to file, used by another processus
> 
> Regards
> Eric
> 
> -----Message d'origine-----
> De : Martin Stockhammer < <ma...@apache.org> martin_s@apache.org>
> Envoyé : vendredi 14 février 2020 08:37
> À :  <ma...@archiva.apache.org> dev@archiva.apache.org
> Objet : Re: Test fails( on Windows)
> 
> Hi Eric,
> 
> sorry, I missed your last mail about the filelock issue. I will check the PR today.
> 
> Regards
> 
> Martin
> 
> On 14.02.20 01:09, Eric Barboni wrote:
> 
> Hi,
>    Jumping late in the conversation for the failing test on windows.
>    
> 
>   
> 
> 

RE: Test fails( on Windows)

Posted by Eric Barboni <sk...@apache.org>.
Hi,

 

For example in archiva-maven-indexer

 

MavenIndexManagerTest cannot delete recursive using archiva fileutils. Accesdenied seems to be the root cause.

 

Error during recursive delete of E:\jj\workspace\a\archiva-modules\archiva-maven\archiva-maven-indexer\target\repositories\test-repo\.index-test

 

Maybe insuring each test on his own repo can be a solution

 

Best Regards

Eric

 

 

 

De : Martin Stockhammer <ma...@apache.org> 
Envoyé : jeudi 20 février 2020 17:58
À : dev@archiva.apache.org; Eric Barboni <sk...@apache.org>
Objet : RE: Test fails( on Windows)

 

Hi Eric,

do the filelock related fails only occur in the filelock module, or do they occur in other modules too?
If the former, we should focus on the deletion issues. File locking on Windows is always good for headaches :-/ and we should keep them for later.

About file deletion fails:
Do you have examples? I think we should use our FileUtils.deleteQuietly() for deletion in all unit tests. And maybe improve the util method as necessary (add a delete on vm shutdown)

If file deletion in production methods does not work, I need concrete examples. My windows system here is very limited. I can only use it for simple test cases, no chance to build the whole archiva stack on it.

Thank you and regards

Martin






Am 20. Februar 2020 14:47:45 MEZ schrieb Eric Barboni < <ma...@apache.org> skygo@apache.org>:

Hi Martin,
 Others test issues are more difficult to handle (about 350).

  Deletion is almost impossible due to access denied, still locked file.
 
The stress test is failing a lot of time
 org.apache.archiva.common.filelock.DefaultFileLockManagerTest.testWrite
 org.apache.archiva.common.filelock.DefaultFileLockManager.writeFileLock(DefaultFileLockManager.java:222)
 cannot access to file, used by another processus

Regards
Eric

-----Message d'origine-----
De : Martin Stockhammer < <ma...@apache.org> martin_s@apache.org> 
Envoyé : vendredi 14 février 2020 08:37
À :  <ma...@archiva.apache.org> dev@archiva.apache.org
Objet : Re: Test fails( on Windows)

Hi Eric,

sorry, I missed your last mail about the filelock issue. I will check the PR today.

Regards

Martin

On 14.02.20 01:09, Eric Barboni wrote:

Hi,
  Jumping late in the conversation for the failing test on windows.
  

 


-- 
This message was sent from mobile phone.


RE: Test fails( on Windows)

Posted by Martin Stockhammer <ma...@apache.org>.
Hi Eric,

do the filelock related fails only occur in the filelock module, or do they occur in other modules too?
If the former, we should focus on the deletion issues. File locking on Windows is always good for headaches :-/ and we should keep them for later.

About file deletion fails:
Do you have examples? I think we should use our FileUtils.deleteQuietly() for deletion in all unit tests. And maybe improve the util method as necessary (add a delete on vm shutdown)

If file deletion in production methods does not work, I need concrete examples. My windows system here is very limited. I can only use it for  simple test cases, no chance to build the whole archiva stack on it.

Thank you and regards

Martin





Am 20. Februar 2020 14:47:45 MEZ schrieb Eric Barboni <sk...@apache.org>:
>Hi Martin,
> Others test issues are more difficult to handle (about 350).
>
> Deletion is almost impossible due to access denied, still locked file.
> 
>The stress test is failing a lot of time
>org.apache.archiva.common.filelock.DefaultFileLockManagerTest.testWrite
>org.apache.archiva.common.filelock.DefaultFileLockManager.writeFileLock(DefaultFileLockManager.java:222)
> cannot access to file, used by another processus
>
>Regards
>Eric
>
>-----Message d'origine-----
>De : Martin Stockhammer <ma...@apache.org> 
>Envoyé : vendredi 14 février 2020 08:37
>À : dev@archiva.apache.org
>Objet : Re: Test fails( on Windows)
>
>Hi Eric,
>
>sorry, I missed your last mail about the filelock issue. I will check
>the PR today.
>
>Regards
>
>Martin
>
>On 14.02.20 01:09, Eric Barboni wrote:
>> Hi,
>>   Jumping late in the conversation for the failing test on windows.
>>   
>> 

-- 
This message was sent from mobile phone.

RE: Test fails( on Windows)

Posted by Eric Barboni <sk...@apache.org>.
Hi Martin,
 Others test issues are more difficult to handle (about 350).

  Deletion is almost impossible due to access denied, still locked file.
 
The stress test is failing a lot of time
 org.apache.archiva.common.filelock.DefaultFileLockManagerTest.testWrite
 org.apache.archiva.common.filelock.DefaultFileLockManager.writeFileLock(DefaultFileLockManager.java:222)
 cannot access to file, used by another processus

Regards
Eric

-----Message d'origine-----
De : Martin Stockhammer <ma...@apache.org> 
Envoyé : vendredi 14 février 2020 08:37
À : dev@archiva.apache.org
Objet : Re: Test fails( on Windows)

Hi Eric,

sorry, I missed your last mail about the filelock issue. I will check the PR today.

Regards

Martin

On 14.02.20 01:09, Eric Barboni wrote:
> Hi,
>   Jumping late in the conversation for the failing test on windows.
>   
> 


Re: Test fails( on Windows)

Posted by Martin Stockhammer <ma...@apache.org>.
Hi Eric,

sorry, I missed your last mail about the filelock issue. I will check 
the PR today.

Regards

Martin

On 14.02.20 01:09, Eric Barboni wrote:
> Hi,
>   Jumping late in the conversation for the failing test on windows.
>   
>