-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect to testing platform runner process when using testing platform server mode #4729
Comments
Are you using VSTest or Microsoft.Testing.Platform? Have you enabled EnableMSTestRunner property? If so, can you try to DotNet run or F5 the test project to see if it works? If you have then you don't need the Test host package. |
Can confirm that this issue prevents testing with MSTest (freezes indefinitely) and can be fixed by disabling the |
Without server mode, MSTest discovery fails with
|
It works |
Yes |
@EvgenyMuryshkin Probably SDK package is too new for your Visual Studio |
@xperiandri is dropping @EvgenyMuryshkin Can you provide more info and maybe open a different issue as it seems unrelated to this problem. |
I am not sure how to describe the issue. Most of the time it is boiled down to
In general, it is 2-3 hours of random walking and googling until it runs. I need to pin it to something more specific before creating an issue, otherwise, it will need more info and then be closed eventually. Thanks, |
@xperiandri can you enable diagnostic logging (tools -> options -> test -> logging level)? the output window should include the full command that's executed by the test explorer ( could you run that command from command line? it should fail with a SocketException when trying to connect to the client port (because client port is only created for the duration of the test explorer run). the error message suggests that the application crashes sooner than that and it would be good to see the failing stack trace |
The same with |
Test output window
|
@EvgenyMuryshkin This is sadly a known Test Explorer behavior but the VS team is not fixing it https://developercommunity.visualstudio.com/t/Warning-Could-not-determine-target-dev/10411558. There is nothing I can do and it's not linked to MSTest so please feel free to comment on the community issue linked above. |
As per my tests this package is not having impact. @thomhurst do you have a scenario where it's causing an issue? |
It definitely breaks TUnit. Code:
Working csproj
Broken csproj
Try a simple |
@Evangelink it seems that Microsoft.NET.Test.Sdk and TUnit are fighting over the generated entry point |
the other issues might be different, which is why knowing the tfm of the failing projects and trying to run the full command on command line would help in understanding what is the exception that causes the process to be unable to start up |
@thomhurst We do disable VSTest main when we enable support for MTP. We will let you decide whether you want to disable it preventively if people are using |
How would I make TUnit force disabling VSTest? |
You want to add the following to your prop file |
Why doesn't the use test platform set that out of curiosity? They'd never be compatible? |
I have XUnit and MSTest in my test project and I failed to run the tests with "Unable to connect to testing platform.." error. Unsetting the flag "Use testing platform server mode" in Preview Features helped to solve the problem. Thank you guys for usefull discussion |
Why should the platform be aware of the other platform? ;)
You cannot mix test frameworks for a given project |
Occasionally, if there is no reference to MSTest.TestAdapter and MSTest.TestFramework, then (XUnit or NUnit) tests are not discovered. This situation changes from VS build to build. I will create a new issue once this happens again with VS versions. |
If you can create and share a reproducer that would be great because there should be no reason to have a framework impacting another one. Especially for MTP. |
Ha? You can mix test frameworks - we have numerous projects mixing MSTest and Xunit which up until this issue were working harmoniously without issue - Like @ruzena-kavanova unchecking Use testing platform server mode resolved our issue. |
You can with VSTest, you cannot with MTP. If you do enable MTP support (property depends upon your test framework) you should see an error message explaining this is not supported. |
Describe the bug
When this flag is enable
![Image](https://private-user-images.githubusercontent.com/2365592/404712416-967b9412-8e6b-4c58-8c15-bf81469208d5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0Mzc3MjcsIm5iZiI6MTczOTQzNzQyNywicGF0aCI6Ii8yMzY1NTkyLzQwNDcxMjQxNi05NjdiOTQxMi04ZTZiLTRjNTgtOGMxNS1iZjgxNDY5MjA4ZDUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTNUMDkwMzQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTgzMzRiY2VkZTg3ZmJhZjFhNzkzZDE4OGY3ZmRhZDA1ZDIxODU0NDUwYjdmNTkzZGQzODVkZTYwYjE3ZGU0MSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.lnrS6va29fz39px_IsQbC_piTxgxm_faUZnPuYq1KxQ)
I see
Steps To Reproduce
I don't know. How can I reproduce that?
Expected behavior
Tests are discovered
Actual behavior
Tests are not discovered
Additional context
Both
Microsoft Visual Studio Enterprise 2022 (64-bit) Version 17.12.4
Microsoft Visual Studio Enterprise 2022 (64-bit) Version 17.13.0 Preview 2.1
affected
also I see
AB#2353765
The text was updated successfully, but these errors were encountered: