junit-plugin icon indicating copy to clipboard operation
junit-plugin copied to clipboard

Some Junit test results are randomly being dropped

Open armaanPy opened this issue 1 year ago • 2 comments

Jenkins and plugins versions report

Plugins
JUnit Plugin - v1.29

What Operating System are you using (both controller, and any agents involved in the problem)?

Controller - Linux (amd64) Agent(s) - Windows 10 (amd64)

Reproduction steps

  1. Step 1: Run 14 tests in Jenkins in parallel shared across 9 Windows agents.
  2. Step 2: All of the 14 tests generate an XML file which is successfully stashed.
  3. Step 3: Post build, unstash the XML files,
  4. Step 4: Execute the Junit test archive command with: junit allowEmptyResults: false, testResults: '**\\*.xml'

Expected Results

I expect to see 14 test results at all time.

Actual Results

This is random, on some occasions I see all 14 test results output to Jenkins, and on other occasions I only see 13 or 12.

Anything else?

We are currently running JUnit plugin v.129 on Jenkins, I am not certain if my issue is related to https://issues.jenkins.io/browse/JENKINS-48583, therefore I raised this issue.

armaanPy avatar Nov 17 '22 10:11 armaanPy

Please provide a minimal reproduce able test case.

A pipeline that can reproduce this would likely be most appropriate

timja avatar Nov 17 '22 10:11 timja

@timja Apologies for the formatting, but I am running something like this. We are currently running JUnit plugin v.129 on Jenkins, I am not certain if my issue is related to https://issues.jenkins.io/browse/JENKINS-48583.

pipeline { agent { node { label "Win" } } stages { stage('Tests') { parallel { stage('Test1') { agent { node { label "Windows && aws && r5.2xlarge" } } steps { dir('TestLab') { script { final runTest1 = runSingleTest("Test1", "Test1.xml", "Test1.log") bat """ ${runTest1} """ } stash allowEmpty: false, includes: "Test1.xml", name: "Test1-XML" cleanWs() } } } stage('Test2') { agent { node { label "Windows && aws && r5.2xlarge" } } steps { dir('TestLab') { script { final runTest2 = runSingleTest("Test2", "Test2.xml", "Test2.log") bat """ ${runTest2} """ } stash allowEmpty: false, includes: "Test2.xml", name: "Test2-XML" cleanWs() } } } stage('Test3') { agent { node { label "Windows && aws && r5.2xlarge" } } steps { dir('TestLab') { script { final runTest3 = runSingleTest("Test3", "Test3.xml", "Test3.log") bat """ ${runTest3} """ } stash allowEmpty: false, includes: "Test3.xml", name: "Test3-XML" cleanWs() } } } } post { always { dir('XML_Outputs') { unstash 'Test1-XML' unstash 'Test2-XML' unstash 'Test3-XML' junit allowEmptyResults: false, testResults: '**\*.xml' } cleanWs( cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenSuccess: true, cleanWhenUnstable: true, ) } } } } }

armaanPy avatar Nov 17 '22 11:11 armaanPy