none
Randomly receiving an error "The agent process was stopped while the test was running." RRS feed

  • Question

  • Hello,

    I have 4 projects in the solution. First 3 projects was fine and when the test started for the 4the project , I am getting the following message "The agent process was stopped while the test was running."

    And also I saw Bin and Obj folders added to the Project. No sure why these 2 folders were added.

    I appreciate someone's help in this matter. 

    Thank you in advance.

    PV


    PV

    Tuesday, October 15, 2019 8:50 PM

All replies

  • Hi PV,

    Thank you for posting here.

    >> I am getting the following message "The agent process was stopped while the test was running."

    ## There are a lot of possibilities that might cause this issue, but usually this issue caused by the exceptions of threads. You could refer to the following suggestions to narrow down this issue.

    #1. If there are some unhandled exceptions on a background thread(or a thread different from the main/test thread), the test process might crash and generate this error message.

    For example, not catch the unexpected exceptions or stack overflow occurs. Sometimes, an explicit call to Process.GetCurrentProcess( ).Kill( ) or Environment.Exit(0) affects.

    #2. Another possibility (a special case of uncaught exceptions) is that if there occurs some exceptions in you have finalizers and that finalizer runs before all tests has finished, Visual Studio might give this error message.

    So I suggest you could check the program and make sure that there won’t occur any uncaught exception when under testing.

    >> And also I saw Bin and Obj folders added to the Project. No sure why these 2 folders were added.

    ## Like the ‘Build’ and ‘Debug’, ‘Test’ also creates .bin and .obj folders to save test files like unit test .dll files and the corresponding .pdb file.

    Hope all above could help you.

    Best Regards,

    Tianyu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, October 16, 2019 7:18 AM
  • Than you for your response Tianyu.

    This  "The agent process was stopped while the test was running." error is coming on the same test case everytime I run the build and also there is another build, the error message  occurs on the first Test Case itself.

    It used to work fine and never got this message for the 2 years for the same build and also I did not make any changes to the build or Test cases, not sure and I am not able figure it out where exactly issue is .

    If you can please help me out with more details, exactly where can I find the issue and fix it.

    Thank you in advance




    PV

    Thursday, October 17, 2019 2:52 PM
  • Hi friend, 

    Did your test projects need to run on the remote machines? If so, please try to re-start and re-logon agents on remote machines. If you want to run these projects on local environment, please disable related settings about remotely running in runsettings file or testsettings file. 

    Hope it could help you.

    Cheers,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, October 18, 2019 5:51 AM
  • Thank You Dylan.

    I am running my rest in the Remote machine and I restarted and relogin the Remote machine and Test Agents.

    When I went back and ran the test case manually, it was falling and giving the follwoing exception - {"Exception of type 'System.StackOverflowException' was thrown."}.

    Is something wrong with the UI Map ? , but theses test cases were worked fine and suddenly stopped working  and I did not made any changes to it.

    Thank you


    PV

    Friday, October 18, 2019 2:19 PM
  • HI friend, 

    Thank you for feedback.

    Could you share the part of exception here? And we also recommend you could try to go to the directory in remote machine, then clear caches.

    C:\Users\[user name]\AppData\Local\VSEQT\QTAgent

    Cheers,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Monday, October 21, 2019 8:10 AM
  • Hi friend,

    Sorry to disturb you.

    Did Dylan’s suggestions solved you issue?

    After checking the exception you shared above, I suppose “StackOverflowException” might be more related to the codes(infinite recursion maybe refractory by accident and not be found by test framework), though I knew you didn’t change any of them.

    I suggest you could try to debug the test and check if the test will stop and report any error message.

    In Test Explorer -> select the test failed to run -> right-click it and choose Debug.

    Hope this could help you and any feedback will be expected.

    Best Regards,

    Tianyu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, October 30, 2019 9:06 AM