You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we retried a test, show list of tests that needed to be retried to the user if they specify
--show-retried-tests
When we retried a test and it succeeded, show the list of such tests to the user if they specify
--show-flaky-tests
Background and Motivation
users want to know which tests are potentially flaky, and might want to have easy overview of what tests failed and were retried at least once.
Caveat is that we have folded dynamic tests, and these tests will re-run all tests including tests that prevoiusly passed, so they will appear among flaky tests, and we cannot identify them better because testnodeuid is not unique per such tests, but per the test method that produces multiple results.
After looking into this a bit more, this is complicated by the fact that some tests can re-run and always succeed because of how folded tests work. At the same time we don't have enough information about those tests to be able to tell them apart, and link together only results that have the same source data. So some of the tests can pass when, and some other tests with other data can fail, and we don't know which is which.
Sam Harwell (@sharwell) I am tracking the ask you had here. I will have to come back to it later, it is not as simple as I thought to make it reliable.
But when we do have a report of the flaky tests, would it still be useful enough if we just print a list of those tests into results? We don't have a category for that in trx format AFAIK, or UI in azdo. And we don't have a new test report format yet, that would be able to communicate this.
On the caveat raised above about folded data-driven tests: attribution is per TestNodeUid, so a folded test counts once. That is the same rule Microsoft.Testing.Extensions.CtrfReport already implements, and it is documented rather than worked around.
No separate --show-retried-tests option was added: retried tests are counted on the retried: line, but retried-but-never-recovered tests are not listed by name because the last attempt already reports them as failures with their full error output.
Activity
nohwnd commentedon Apr 8, 2025
After looking into this a bit more, this is complicated by the fact that some tests can re-run and always succeed because of how folded tests work. At the same time we don't have enough information about those tests to be able to tell them apart, and link together only results that have the same source data. So some of the tests can pass when, and some other tests with other data can fail, and we don't know which is which.
nohwnd commentedon Apr 8, 2025
Sam Harwell (@sharwell) I am tracking the ask you had here. I will have to come back to it later, it is not as simple as I thought to make it reliable.
But when we do have a report of the flaky tests, would it still be useful enough if we just print a list of those tests into results? We don't have a category for that in trx format AFAIK, or UI in azdo. And we don't have a new test report format yet, that would be able to communicate this.
Report retried and flaky tests by name (#5362) (#10329)
Evangelink commentedon Jul 30, 2026
Implemented by #10329 (merged to
main).The retry summary now reports flaky tests by name, gated by
--show-flaky-tests(on/off, on by default):On the caveat raised above about folded data-driven tests: attribution is per
TestNodeUid, so a folded test counts once. That is the same ruleMicrosoft.Testing.Extensions.CtrfReportalready implements, and it is documented rather than worked around.No separate
--show-retried-testsoption was added: retried tests are counted on theretried:line, but retried-but-never-recovered tests are not listed by name because the last attempt already reports them as failures with their full error output.The remaining halves are tracked separately:
[Retry]attempts are discarded before they reach the platform, so in-process retries are invisible everywhere #10292 — in-process[Retry]attempts never reach the platform, so the same flakiness is invisible for[Retry].--retry-failed-testsleaves only the last attempt's report in the results directory, so TRX/CTRF/JUnit under-report the run #10293 —--retry-failed-testsleaves only the last attempt's TRX/CTRF/JUnit report in the results directory.Closing as completed; please reopen if the named list of retried (as opposed to flaky) tests is still wanted.