-
Notifications
You must be signed in to change notification settings - Fork 320
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
Tests never finish when JsonConvert DefaultSettings changed #1360
Comments
@ejcoyle88 , We use JsonConvert.SerializeObject to serialize the message we need to send back to vstest runner. Since you are modifying the default Json Serializer, vstest.console does not understand the message it receives from testhost process. Meanwhile testhost is waiting to receive an appropriate shutdown message from vstest.console, which it never receives. This is causing the system to be in hung state. Can you please change your test code to not modify Default settings of JsonConvert, rather create your own custom Json Serializer, & use it serialize data? You can take reference from here. |
Hi @mayankbansal018, We've already gone ahead and reworked our projects to use the serializer this way. 😄 If this isn't something that can be fixed within the test runner, it would be much better for debugging if the runner could report an error when the JsonConvert.DefaultSettings are in a form that would cause it to hang. |
@ejcoyle88 , thanks for bringing this issue. Investigating this helped us realized how our serialization can get impacted. We plan to discuss this further internally. |
Description
Hopefully I am reporting this in the correct place, sorry if not!
Running in either VS2017 or using
dotnet test
, the runner hangs indefinitely if theJsonConvert.DefaultSettings
have been set as below:I have tested this using MSTest, Nunit and Xunit and the same issue seems to happen across the board, which leads me to believe its the vstest runner itself.
Steps to reproduce
XUnitTestProject1.zip
Above is a sample project with 2 tests. One which hangs and one which doesn't.
Expected behavior
For the tests to finish running
Actual behavior
Tests never finish running. I have to go and end the dotnet process manually.
Diagnostic logs
logs.zip
Environment
Windows 10, .net core 2.0
AB#1866683
The text was updated successfully, but these errors were encountered: