none
Parallel and Sequential exceution in Visual Studio takes the same time-Issue RRS feed

  • Question

  • I am trying to run the unit tests in parallel in test explorer by adding the below in run settings and selecting parallel mode

    <RunConfiguration>

    <MaxCpuCount>0</MaxCpuCount>

    </RunConfiguration>

    The number of logical processors is 8 in the loacal machine.

    But the time taken to run the tests is same (around 5 mins) for parallel and sequential execution.Can you please help with this.

    Also trying to run in VSTS in parallel does not decrease the execution time.Is there any other settings to be done/whats the issue??

    Thursday, January 25, 2018 3:49 PM

All replies

  • May I ask what exactly number of CPU count did you set?

    Reference:

    https://msdn.microsoft.com/en-us/library/jj635153.aspx?f=255&mspperror=-2147217396#Anchor_2

     

    For more VSTS support you might need post the thread to Stack Overflow or Developer Community, where also the MS support engineers will help you with it, as VSTS forums on MSDN has retired.

    Thanks for your understanding.

     

    Regards,

    Fletcher


    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.


    • Edited by Fletch Zhou Friday, January 26, 2018 7:09 AM
    Friday, January 26, 2018 7:09 AM
  • Hi Fletcher,

    Thanks for the response!

    I have given the MaxCPUCount as 0 which means it should as many processors available in my machine during the test execution.

    Logical processors available :8

    Thanks,

    Deepa

    Monday, January 29, 2018 1:31 PM
  • Have you tried to switch to any other number of MaxCPUCount ? Still same time?

    Maybe I should ask how many test methods do you have, more than one right?

    Or I wonder if your .testsettings file works, you could try to use the default parallel tab in VS:

     

    Regards,

    Fletcher


    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.


    • Edited by Fletch Zhou Tuesday, January 30, 2018 3:14 AM
    Tuesday, January 30, 2018 3:14 AM
  • Yeah! I have more than 1 test method to be executed(400)

    So I have tried the following:

    1.Changing the runsettings file-in run configuration including the  maxcpucount as 0 which I assume should consider the total number of logical processors available

    2.And have enabled the parallel run in test explorer

    Still no luck!

    but when I try changing the maxCPUcount to 8(the processors) and enabling the parallel execution-still no luck!

    Execution time is same.

    Tuesday, January 30, 2018 10:36 AM
  • How is the time displayed in your test explorer?

    I wrote some test methods and tested them in my VS(run in parallel) and Run all:

    Only the first one took 10ms, others are shown less than 1ms

    And if I run the method one by one (with no parallel )

    Each method would be 10ms every time.

    So how is it like in your side ?

    Update: Just found out even I did not select the parallel tab, it still took the same time as run in parallel. Maybe it always run in parallel when run all tests methods? Don't know why, but I look into it, and let you know if it's limitation of this version Visual Studio.

    Sorry about the inconvenience. 

     

    Regards,

    Fletcher


    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.



    • Edited by Fletch Zhou Wednesday, January 31, 2018 8:42 AM
    Wednesday, January 31, 2018 8:32 AM
  • Thanks Fletcher!

    Please do let me know why I am facing this issue at at the latest.

    I am using visual studio 2017,if it helps!

    Regards,

    Deepa

    Thursday, February 1, 2018 3:48 PM
  • Hi Deepa,

    Sorry for the inconvenience, I've reported it to VS developing team:

    https://developercommunity.visualstudio.com/content/problem/193424/run-unit-test-in-parallel-seems-does-not-work.html

     

    Let's wait and see what VS developing team will response after the investigation. You also could go to the link above and vote or comment it.

    Thanks for your patience.

     

    Regards,

    Fletcher


    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.


    • Edited by Fletch Zhou Monday, February 5, 2018 7:16 AM
    Monday, February 5, 2018 7:16 AM
  • sure! Thanks Fletcher.
    Monday, February 5, 2018 10:30 AM
  • Thanks for your understanding:)

     

    Regards,

    Fletcher


    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.


    • Edited by Fletch Zhou Tuesday, February 6, 2018 2:34 AM
    Tuesday, February 6, 2018 2:33 AM