Skip to content

MTP Extension - Flaky Tests #4931

Done
Done

Description

This would need a backing storage that can persist in between test runs.

This is obviously doable by creating an interface that the user consumes. But the way extensions are set up is that they're auto registered aren't they?

Have you got mechanisms for registering extensions that might require input, without rewriting your own entry method?

Activity

  1. added
    area/mtp
    area/mtp-extensions
    on Feb 6, 2025
  2. nohwnd commented on Feb 6, 2025

    @nohwnd
    Member

    What is the challenge you see here? Reading what you wrote, it sounds to me as an extension that registers additional parameter, and consumes the tests to run via that.

    (I don't think extensions can currently control execution on that level, but let's put that aside.)

  3. thomhurst commented on Feb 6, 2025

    @thomhurst
    ContributorAuthor

    Not quite sure I understand your reply. Your retry extension can tell which tests have failed. If we could attach a persistent storage (provided by the user via an interface) we could compare this run to previous runs, and then flag flaky tests via warnings or information logs

  4. thomhurst commented on Feb 6, 2025

    @thomhurst
    ContributorAuthor

    When a test run finishes, it's stores it's passed/failed/skipped somewhere via that interface. And when ran again, it does the same and also compares against the previous X records

  5. nohwnd commented on Feb 6, 2025

    @nohwnd
    Member

    There was some context missing for me :)

    I can see this working in multiple ways, like storing the state next to the executable, so the extension can pick it up in subsequent runs.

  6. thomhurst commented on Feb 6, 2025

    @thomhurst
    ContributorAuthor

    I think it'd be very useful for a lot of people. Just the question around auto registration since it's need user input (the interface)

  7. nohwnd commented on Feb 6, 2025

    @nohwnd
    Member

    Yeah and that is the part I am failing to understand how you meant that and where is the challenge there. Do you have some code example of what the problem would be?

  8. thomhurst commented on Feb 6, 2025

    @thomhurst
    ContributorAuthor

    Well for instance you currently can install the TRX extension and invoke it via the cli.. you couldn't do that for a flaky test extension if you needed to supply it and interface

  9. Evangelink commented on Feb 10, 2025

    @Evangelink
    Member

    I am also not quite sure to understand what's your question/intent. Would you like us to provide a service for story state/info about test results across runs? Are you asking how you could build you own extension that would save data?

  10. added
    type/discussion
    needs/author-feedback
    and removed
    needs/triage
    on Feb 10, 2025
  11. thomhurst commented on Feb 10, 2025

    @thomhurst
    ContributorAuthor

    Yeah building an extension that can compare data across runs.

    Like Jakub Jareš (@nohwnd) said, you could store it next to the executable, but for thinks like GitHub pipelines, you'd need to commit this data after every run which may not be ideal.

    So I thought the user could specify how to store and retrieve the test results via an interface so they can use any storage mechanism (e.g. cosmosdb, blob storage)

    But since extensions are usually auto registered, and users don't define their own entry points, I don't know how you'd achieve that.

    Does that make more sense?

  12. added
    needs/attention
    and removed
    needs/author-feedback
    on Feb 10, 2025
  13. Evangelink commented on Feb 10, 2025

    @Evangelink
    Member

    Does that make more sense?

    It does! Thanks

    building an extension that can compare data across runs.

    This is part of the suggestions I have made but so far no priority was given on it.

    users don't define their own entry points

    This is a mistake to me. We had to do that to ease transition from VSTest but my ideal design is that the main is explicit in the user project, like it's the case for ASP.NET, Console... We should stop trying to be to magic and hide things to users, that's the main reason why we end up building complex infrastructure for things that should be easy for users.

    I don't know how you'd achieve that

    As stated above, I'd go with explicit main but if you want to keep the hidden/generated mechanism then I'd expose the various supports you want to provide and users have to define the source and args by command line or through the json.

  14. Youssef1313 commented on Oct 11, 2025

    @Youssef1313
    Member

    Related to #5951

  15. Youssef1313 commented on Nov 7, 2025

    @Youssef1313
    Member

    NOTE: https://github.com/jaredpar/runfo is already used by dotnet/roslyn for (at least) tracking of flaky tests. Example issue: dotnet/roslyn#58199

    I think we can try to provide something with AzDO APIs (this would be a child of #5951).

  16. Youssef1313 commented on Jun 2, 2026

    @Youssef1313
    Member

    #8761 has a conrete proposal on how I think flaky tests should be handled.

  17. Evangelink commented on Aug 26, 2026

    @Evangelink
    Member

    Tom Longhurst (@thomhurst) there are some bits that have been implemented as part of the ADO extension. Please try it out.

  18. thomhurst commented on Aug 26, 2026

    @thomhurst
    ContributorAuthor

    Nice Amaury Levé (@Evangelink) - I don't use ADO though - just GitHub!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/mtparea/mtp-extensionstype/discussion

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions