[JIRA] (JENKINS-56502) xunit thresholds may have a bug in parallel pipeline runs

2 views
Skip to first unread message

vladichko@gmail.com (JIRA)

unread,
Mar 11, 2019, 8:25:01 AM3/11/19
to jenkinsc...@googlegroups.com
Vlad Aginsky created an issue
 
Jenkins / Bug JENKINS-56502
xunit thresholds may have a bug in parallel pipeline runs
Issue Type: Bug Bug
Assignee: Nikolas Falco
Components: xunit-plugin
Created: 2019-03-11 12:24
Priority: Major Major
Reporter: Vlad Aginsky
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

vladichko@gmail.com (JIRA)

unread,
Mar 11, 2019, 8:37:02 AM3/11/19
to jenkinsc...@googlegroups.com
Vlad Aginsky updated an issue
Change By: Vlad Aginsky
This is spin-off issue from https://issues.jenkins-ci.org/browse/JENKINS-54255

i think that it is better not to abuse old closed issue with this one.

here is the summary of discussion i had with Nicholas.:

======================================

i see that xunit thresholds produce non deterministic results in parallel pipe runs 

This is how i define xunit thresholds:

 
{code:java}
xunit thresholds: [failed(unstableThreshold: '0',failureNewThreshold: '0')],
                tools: [Custom(customXSL: "${JENKINS_URL}/userContent/pytest-to-junit.xsl",
                     deleteOutputFiles: true,
                     failIfNotNew: true,
                     pattern: "${env.DOWNLOADED_ARTIFACTS_PATH}/${env.TEST_RESULTS_PATH}/*.xml",
                     skipNoTestFiles: true,
                     stopProcessingIfError: true)]
{code}
 I run few parallel branches of jenkins pipe, each in its own workspace and each pipe branch uploads it test results independently.

 

I have some build new failed tests:
|!https://swdvp-jnk01.anpa.corp.amazon.com:9080/static/da57df94/images/48x48/clipboard.png!|Test Result (40 failures / +17)|

  i expect to get failed status, but xunit still sets the build to be unstable:
{code:java}
01:57:59.736  INFO: Starting to record.
01:57:59.736  INFO: Processing Custom Tool
01:58:00.146  INFO: Stopping recording.
01:58:00.147  INFO: Check 'Failed Tests' threshold.
01:58:00.147  INFO: The new number of tests for the threshold 'Failed Tests' exceeds the specified "new failure threshold" value.
{code}
 I use:
*  [Jenkins ver. 2.160|https://jenkins.io/]
*  xUnit plugin 2.3.2

 On this Nicolas kindly replied:

Anyway if this is your configuration (it's not clear from your post, seems commented)
{noformat}
xunit thresholds: [failed(unstableThreshold: '0',failureNewThreshold: '0')],
{noformat}
the unstable build status is correct and is in accordance with what the tooltips document.

 

vladichko@gmail.com (JIRA)

unread,
Mar 11, 2019, 8:43:02 AM3/11/19
to jenkinsc...@googlegroups.com
 On this Nicolas kindly replied some more details :

Anyway I want to define following behavior:

{{_Any new failed test to fail the build,
if no new failures, any old failure to cause to unstable build status._ }}

This is how I use Snippet Generator  

!image-2019-03-04-09-13-18-589.png|width=646,height=150!

this is your configuration ( what it 's not clear from your post, seems commented) produces:

 
{ noformat code:java }
xunit thresholds: [failed(
unstableThreshold failureNewThreshold : '0', failureNewThreshold unstableThreshold : '0')], tools: []
{
noformat code }
the unstable build status is correct and is *Important note:* i see that in accordance with what the tooltips document some cases it behaves just right, but sometimes it produces yellow status on new failed tests, just as described above .

 

vladichko@gmail.com (JIRA)

unread,
Mar 11, 2019, 8:44:02 AM3/11/19
to jenkinsc...@googlegroups.com
some more details:


I want to define following behavior:

{{_Any new failed test to fail the build, if no new failures, any old failure to cause to unstable build status._ }}

This is how I use Snippet Generator  

!image-2019-03-04-09-13-18-589.png|width= 646 534 ,height= 150 124 !

this is what it produces:

 
{code:java}
xunit thresholds: [failed(failureNewThreshold: '0', unstableThreshold: '0')], tools: []
{code}
*Important note:* i see that in some cases it behaves just right, but sometimes it produces yellow status on new failed tests, just as described above.

 

vladichko@gmail.com (JIRA)

unread,
Mar 11, 2019, 8:45:02 AM3/11/19
to jenkinsc...@googlegroups.com
!image-2019-03-04-09-13-18-589.png|width= 534 676 ,height= 124 157 !


this is what it produces:
 
{code:java}
xunit thresholds: [failed(failureNewThreshold: '0', unstableThreshold: '0')], tools: []
{code}
*Important note:* i see that in some cases it behaves just right, but sometimes it produces yellow status on new failed tests, just as described above.

 

vladichko@gmail.com (JIRA)

unread,
Mar 11, 2019, 8:47:02 AM3/11/19
to jenkinsc...@googlegroups.com
!image-2019-03- 04 11 - 09 14 - 13 46 - 18 28 - 589 394 .png|width= 676 568 ,height= 157 132 !

 

this is what it produces: 
{code:java}
xunit thresholds: [failed(failureNewThreshold: '0', unstableThreshold: '0')], tools: []
{code}
*Important note:* i see that in some cases it behaves just right, but sometimes it produces yellow status on new failed tests, just as described above.

 

vladichko@gmail.com (JIRA)

unread,
Mar 11, 2019, 8:47:03 AM3/11/19
to jenkinsc...@googlegroups.com
Vlad Aginsky updated an issue
Change By: Vlad Aginsky
Attachment: image-2019-03-04-09-13-18-589.png

vladichko@gmail.com (JIRA)

unread,
Mar 11, 2019, 8:47:03 AM3/11/19
to jenkinsc...@googlegroups.com
Vlad Aginsky updated an issue
Change By: Vlad Aginsky
Attachment: image-2019-03-11-14-46-28-394.png

vladichko@gmail.com (JIRA)

unread,
Mar 11, 2019, 8:57:02 AM3/11/19
to jenkinsc...@googlegroups.com
Vlad Aginsky updated an issue
!image-2019-03-11-14-46-28-394.png|width=568,height=132!


 

this is what it produces: 
{code:java}
xunit thresholds: [failed(failureNewThreshold: '0', unstableThreshold: '0')], tools: []
{code}
*Important note:* i see that in some cases it behaves just right, but sometimes it produces yellow status on new failed tests, just as described above.

 


Button line of previous discussion with Nicolas was:Failed thresholds are analysed before unstable thresholds. Total count of test failure are taken into account before of New test failures. This logic is applied to all thresholds (skipped, failed and passed). This means your scenario is not possible.

 

and that doesn't make sense to me:

*Failed thresholds are analysed before unstable thresholds—> thats ok, in example above only fail was supposed to kick-in

*Total count of test failure are taken into account before of New test failures: I hope that means no matter how many total failure there are, in my case new failures will define the outcome.

so after all, it seems that there is a problem with my results, and again, as i wrote above, in most cases it behaves ok, may be relates to some race between  parallel parts of pipe

vladichko@gmail.com (JIRA)

unread,
Mar 11, 2019, 9:00:01 AM3/11/19
to jenkinsc...@googlegroups.com


and that
That doesn't make sense to me:

_ *Failed thresholds are analysed before unstable thresholds —> :*_  thats ok, in example above only fail was supposed to kick-in

_ *Total count of test failure are taken into account before of New test failures: *_ I hope that means no matter how many total failure there are, in my case new failures will define the outcome.

so So, after all, it seems that there is a problem with my results, and again, as i wrote above, in most cases it behaves ok, may be relates related to some race between  parallel parts of pipe

vladichko@gmail.com (JIRA)

unread,
Mar 11, 2019, 9:03:02 AM3/11/19
to jenkinsc...@googlegroups.com
 That doesn't make sense to me:

_*Failed thresholds are analysed before unstable thresholds:*_  thats that's ok, in example above only fail was supposed to kick-in , i hope the logic says that if one threshold declared failure, later threshold cannot cancel it.  

_*Total count of test failure are taken into account before of New test failures:*_ I hope that means no matter how many total failure there are, in my case new failures will define the outcome.

So, after all, it seems that there is a problem with my results, and again, as i wrote above, in most cases it behaves ok, may be related to some race between  parallel parts of pipe

nfalco79@hotmail.com (JIRA)

unread,
Mar 11, 2019, 9:32:01 AM3/11/19
to jenkinsc...@googlegroups.com
Nikolas Falco commented on Bug JENKINS-56502
 
Re: xunit thresholds may have a bug in parallel pipeline runs

If for parallel run you mean a multi-branch pipeline project where each job has an own jenkins job and (as you describe) workspace and so on... that this is not a parallel run. It has no issue in that way. If you mean that there is just a jenkins job but you can cun concurrent build and each build has an own workspace than this could be a problem because the xunit plugin takes the total count of previous build that is stored at job level (not workspace) and all depends from who build run xunit plugin as first. I think last case is not your case because you describe run different branch and you had not speak about concurrent build of same job.

To understand better the issue I need the test trend result (latest 10 build are sufficient) where the issue happens

nfalco79@hotmail.com (JIRA)

unread,
Mar 11, 2019, 9:33:03 AM3/11/19
to jenkinsc...@googlegroups.com
Nikolas Falco edited a comment on Bug JENKINS-56502
If for parallel run you mean a multi-branch pipeline project where each job has an own jenkins job and (as you describe) workspace and so on... that this is not a parallel run. It has no issue in that way. If you mean that there is just a jenkins job but you can cun concurrent build and each build has an own workspace than this could be a problem because the xunit plugin takes the total count of previous build that is stored at job level (not workspace) and all depends from who build run xunit plugin as first. I think last case is not your case because you describe run different branch and you had not speak about concurrent build of same job. This to say that parallel is not the root cause.

To understand better the issue I need the test trend result (latest 10 build are sufficient) where the issue happens

nfalco79@hotmail.com (JIRA)

unread,
Mar 11, 2019, 9:42:02 AM3/11/19
to jenkinsc...@googlegroups.com
To understand better the issue I need the test trend result (latest 10 build are sufficient) where the issue happens .
Could you also give to me the job definition (whick kind of job is)

nfalco79@hotmail.com (JIRA)

unread,
Jun 19, 2019, 11:23:02 AM6/19/19
to jenkinsc...@googlegroups.com
Nikolas Falco closed an issue as Cannot Reproduce
 
Change By: Nikolas Falco
Status: Open Closed
Resolution: Cannot Reproduce
Reply all
Reply to author
Forward
0 new messages