Skip to content

Pass attempt label to JUnit output to distinguish test retries#2209

Draft
michelle-clayton-work wants to merge 1 commit intomicrosoft/mainfrom
dev/mclayton/sep-attempts
Draft

Pass attempt label to JUnit output to distinguish test retries#2209
michelle-clayton-work wants to merge 1 commit intomicrosoft/mainfrom
dev/mclayton/sep-attempts

Conversation

@michelle-clayton-work
Copy link
Contributor

@michelle-clayton-work michelle-clayton-work commented Mar 23, 2026

DONT MERGE YET

  • Add -attempt flag to run-builder, passed through to json2junit
  • Each retry attempt writes a unique JUnit XML file (TestResults-attempt-N.xml)
  • Publish all attempt files via wildcard in PublishTestResults
  • Update go-infra dependency to pick up Attempt support in json2junit

This ensures test result entries in AzDO distinguish which attempt they correspond to, both via unique file names and via the attempt label embedded in JUnit test suite names.

Fixes: #2134

-rawtestout '$(Build.SourcesDirectory)/eng/artifacts/RawTestOutput/raw-json-attempt-${{ attempt }}.txt'
-junitout '$(Build.SourcesDirectory)/eng/artifacts/RawTestOutput/TestResults-attempt-${{ attempt }}.xml' `
-rawtestout '$(Build.SourcesDirectory)/eng/artifacts/RawTestOutput/raw-json-attempt-${{ attempt }}.txt' `
-attempt '${{ attempt }}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I wasn't clear about what kind of attempts I meant in #2134... I was thinking about System.JobAttempt. But it actually makes sense to keep each parameters.retryAttempts result as well so that we can use it to track test flakiness in the future. So, I guess we should keep/fix both -attempt and (say) -jobattempt types of retry here.

@michelle-clayton-work michelle-clayton-work force-pushed the dev/mclayton/sep-attempts branch 2 times, most recently from bf0b715 to 4d6827e Compare March 24, 2026 21:14
Add -attempt and -jobattempt flags to run-builder, passed through to
json2junit. This distinguishes test results along two retry dimensions:

- System.JobAttempt (AzDO job-level rerun): passed as -jobattempt
- retryAttempts loop (in-job test retry): passed as -attempt

Each retry attempt writes a unique JUnit XML file
(TestResults-attempt-N.xml) and publishes its own test run. The test
run title includes both labels, e.g.:
  'linux-amd64 test (ubuntu) (job attempt 2, retry 3)'

Suite names inside the XML also include the labels:
  'cmd/go [job attempt 2, retry 3]'

Fixes: #2134
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make test results distinguish the attempt

2 participants