VS 2010 Test Runner error “The agent process was stopped while the test was running.”

前端 未结 19 1573
醉话见心
醉话见心 2020-12-22 21:13

In Visual Studio 2010, I have a number of unit tests. When I run multiple tests at one time using test lists, I sometimes reveive the following error for one or more of the

19条回答
  •  无人及你
    2020-12-22 21:29

    I was having this problem, and it turned out to be a problem in my code which the Test Framework wasn't catching properly. A little accidental refactoring had left me with this code:

    public void GetThingy()
    {
        this.GetThingy();
    }
    

    This is of course an infinite recursion, and caused a StackOverflowException (I guess). What this caused was the dreaded: "The agent process was stopped while the test was running."

    A quick code inspection showed me the problem, and my tests are now running fine. Hope this helps - might be worth inspecting the code looking for issues, or maybe extracting a bit into a console app and checking it works properly there.

提交回复
热议问题