Quantcast

[GitHub] ant-ivy pull request #22: Fix transient test failures

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

[GitHub] ant-ivy pull request #22: Fix transient test failures

janmaterne
GitHub user jaikiran opened a pull request:

    https://github.com/apache/ant-ivy/pull/22

    Fix transient test failures

    The `WarnCircularDependencyStrategyTest` fails once in a while on Jenkins. Looking at the testcase, it resets/updates a shared JVM level logger instance (via `Message.setDefaultLogger`) across test methods. Given that JUnit can run the test methods parallely across different testcase instances, this can (and indeed seems to be) run into race conditions causing the tests to fail. The test was also leaving around the mock message logger as the default logger even after the test was complete.
   
    The commit here fixes these issues and uses a test method specific logger instances and doesn't share them across the test methods. The `IgnoreCircularDependencyStrategyTest` had a similar issue, so that's been included in this fix as well.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jaikiran/ant-ivy logger-test-fix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/ant-ivy/pull/22.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #22
   
----
commit cae1b4425d3cbc27874f4e319edb2b36ca32b589
Author: Jaikiran Pai <[hidden email]>
Date:   2017-05-20T03:43:17Z

    Fix transient test failures - Don't share/update the MockMessageLogger between test methods

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy issue #22: Fix transient test failures

janmaterne
Github user jaikiran commented on the issue:

    https://github.com/apache/ant-ivy/pull/22
 
    Looks like this didn't help. It failed again (passes locally):
   
    >> [junit] Running org.apache.ivy.plugins.circular.WarnCircularDependencyStrategyTest
        [junit] Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0,326 sec
        [junit] Test org.apache.ivy.plugins.circular.WarnCircularDependencyStrategyTest FAILED
   
    Closing this PR for now, till I understand better what's going on.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy pull request #22: Fix transient test failures

janmaterne
In reply to this post by janmaterne
Github user jaikiran closed the pull request at:

    https://github.com/apache/ant-ivy/pull/22


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy issue #22: Fix transient test failures

janmaterne
In reply to this post by janmaterne
Github user nlalevee commented on the issue:

    https://github.com/apache/ant-ivy/pull/22
 
    after many runs on my machine, I think I have found the actual issue. If testRemoveDuplicates is run after testRemoveDuplicates2, then it fails. It seems due to the fact that WarnCircularDependencyStrategy is a singleton and that circularDependencies in AbstractLogCircularDependencyStrategy is thus not reinitialized.
    Not sure yet what the proper fix should be.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy issue #22: Fix transient test failures

janmaterne
In reply to this post by janmaterne
Github user jaikiran commented on the issue:

    https://github.com/apache/ant-ivy/pull/22
 
    That's a good find. Looking at that testcase now again, with this additional detail that you noted, I think the problem here is that the `AbstractLogCircularDependencyStrategy` ends up using a `IvyContext` which has been populated with a resolve id by that `testRemoveDuplicate2` test method. Effectively, it thinks that it has already made a note of that circular dependency and doesn't go ahead and add it or log it.
   
    I think the way to deal with this is to push/pop the relevant `IvyContext` for these test methods without each of them interfering with each other. I can't seem to reopen this PR with the updated testcase, so I'll open a separate PR with the potential fix (plus other few cleanup that I did in those tests previously). Let's see if that solves this issue.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...