I suggest you ...

Starting then running all unit tests in a solution can take a very long time.

We have over 200 projects, 2900+ unit tests. It takes over a minute some times to get to the point where it can start listing all the unit tests in the test window, and start executing. We have latest gen Core I7, 8GB 64 bit windows, and it is still a pain. Maybe this area needs 're-imagining', as I can understand the complexities of managing this large number of projects/tests, but it is not working well for us.

92 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Jason HanshawJason Hanshaw shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    Håkan ForssHåkan Forss shared a merged idea: Running MSTest unit tests is way to slow.  ·   · 

    9 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • David FalknerDavid Falkner commented  ·   ·  Flag as inappropriate

        Yes please at least let me initiate a test run even if all of the tests have not yet been discovered, so that I can focus on other things while the process is running.

      • John PhillipsJohn Phillips commented  ·   ·  Flag as inappropriate

        I would love to see parallel test execution. It's the single largest problem we have with gated check-ins. Since our tests don't run in parallel, it takes to long and our teams stack up.

        The problem would be solved by having parallel unit tests. I'm 100% ok if the test classes were the ones ran in parallel and each class ran it's methods synchronously. That would be a huge win!

      • Joshua Weber - msftJoshua Weber - msft commented  ·   ·  Flag as inappropriate

        As part of VS2012 we added the ability to support multiple 3rd party test frameworks. As a result we need to perform discovery on test binaries and ask all test adapters to locate the tests in their framework.

        We care about performance and have strived to make improvements in most of the updates since RTM. For example, we should be doing smart discover, that we only go and perform a test discovery on binaries that have been changed. This should help in scenarios where you have many tests across many projects, but have only modified a few. In addition, we continue to invest and improve this scenario.

      • Michelle VernerMichelle Verner commented  ·   ·  Flag as inappropriate

        I am disappointed that the VS team response has absolutely nothing related to the question. The question is about the "Discover test" feature, which is insanely, inexcusably slow. This is NOT related to parallel test execution. VS team, please respond to the question about "Discover test" latency.

      • ThomasKThomasK commented  ·   ·  Flag as inappropriate

        Hmm, maybe we have more tests now (~13500), but VS2012 UPD1 is not faster for us.

        ------ Discover test started ------
        WriteTestCaseStarted
        WriteTestCase Took Time = 152849,2834
        ========== Discover test finished: 6377 found (0:02:45,1095093) ==========

      • Simon VaneSimon Vane commented  ·   ·  Flag as inappropriate

        We are having the same issue. Even when the projects we are testing do not change and we just add another test it's taking 40 seconds before running of a single test starts. Many of our tests conflict when running in parallel so that solution doesn't work for us. This is way slower than in VS2010. VS2012 makes testing painful in may ways but taking 40 seconds before a single test starts to run is the worst.

      • Thomas KThomas K commented  ·   ·  Flag as inappropriate

        We have >120 projects in the solution, but starting an added/edited test alone takes > 2 mins at times, which is really painful.
        ------ Discover test started ------
        WriteTestCaseStarted
        WriteTestCase Took Time = 122409,2397
        ========== Discover test finished: 5933 found (0:02:09,1119099) ==========

      • David GrenierDavid Grenier commented  ·   ·  Flag as inappropriate

        Parallel Test execution already works in VS 2010. Enabling it also speeds up the time it takes before testing actually starts (not speaking about the test list window here).

      • David GrenierDavid Grenier commented  ·   ·  Flag as inappropriate

        Note here that if you enable parallel test runs, the pending time is much faster even if running a single test.

        Obviously your tests have to be parallel-friendly.

      Feedback and Knowledge Base