Closed N-Olbert closed 4 years ago
I'm experiencing the same issue on some of my builds.
Mmmh... is this in fact defined behaviour?
"Features that rely on data collectors will need to globally turn OFF parallel execution. They can do so by either crafting a .runsettings file as shown above, or by passing the "--"syntax from the CLI. For e.g. the VSTest task with Test Impact Analysis ON will need to do this when invoking vstest runner." (https://github.com/Microsoft/testfx-docs/blob/master/RFCs/004-In-Assembly-Parallel-Execution.md)
If so, this is not a very good solution. At least the in-assembly parallel execution should be disabled automatically as soon as a data collector is specified. At the very least a warning should be shown.
@N-Olbert the adapters are not aware of whether data collections is enabled or not, & from vstest platform doesn't whether user intends to run tests in parallel within assembly as it can be achieved via adding adapter specific tags on test classes.
I understand this is a problem, but for now this is a design limitation
I'm closing this issue, please comment in case you have some concerns.
Hello @N-Olbert , I can see that you have
Hello @N-Olbert , I can see that you have 1 in your settings file. Does it solve the problem? If not how did you solve the problem?
Hi @DominiqueChabaud. Well… it is defined behavior, you can’t bypass it: Either you use Code Coverage (from MS) or parallel execution. Another option is to use Coverlet instead of MS-Code Coverage, according to the devs it should work fine with parallel execution (see https://github.com/coverlet-coverage/coverlet/issues/864).
The
Hello @N-Olbert. Thanks for your feedback. Our team did the same analysis and choose to deactivate MS Code Coverage and use Coverlet. Have a nice day.
Description
When using MSTestV2 in-assembly parallel test execution in combination with the CodeCoverage-DataCollector vstest.console.dll hangs up indefinitly.
The logs show that vstest.console.dll indefinitly pools (but gets no message):
TpTrace Verbose: 0 : 20700, 12, 2019/08/29, 13:08:30.803, 16201432794, vstest.console.exe, TcpClientExtensions.MessageLoopAsync: Polling on remoteEndPoint: 127.0.0.1:3406 localEndPoint: 127.0.0.1:3405
Using dnspy and Windbg the problem could be traced down to the following line: https://github.com/microsoft/vstest/blob/7317f229d8844ef4826cf406e53d93bd7eb0ffd3/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs#L320
where the binary reader isn't initalized. Therefore a null reference execption will be thrown. After this Exception occured no callback to vstest.console.exe occurs anymore which causes vstest.console.exe to pool indefinitly. The Host-logs show this like this:
Steps to reproduce
The following runsettings file has been used:
Unfortunately I can't share the project as this is a business application. I havent created a demoproject because this error should be relatively easy to reproduce: Simply change the RevceiveRawMessage-method in SocketCommunicationManager.cs to the following:
Expected behavior
No hang up until global test session timeout ocurs
Actual behavior
vstest.console.exe hangs up until global test session timeout occurs.
Environment
Windows 10 V 16299 vstest.console.exe V16.0.28916.169 MStestV2 (framework and adapter) 1.4.0