Skip to content
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

Vstest.console hangs on testhost abnormal exit. #618

Closed
smadala opened this issue Mar 16, 2017 · 1 comment
Closed

Vstest.console hangs on testhost abnormal exit. #618

smadala opened this issue Mar 16, 2017 · 1 comment
Assignees
Labels

Comments

@smadala
Copy link
Contributor

smadala commented Mar 16, 2017

Description

Self referencing loop detected for property 'ManifestModule' with type 'System.Reflection.RuntimeModule'. Path 'TestRunCompleteArgs.Error.TargetSite.Module.Assembly'.

Steps to reproduce

Run a test which abnormally crashes test host, example: ShouldGetErrorMessageOnTesthostExitWithError acceptance test.
Try to serialize exception.

Expected behavior

vstest.console should exit.

Actual behavior

Newtonsoft.Json.JsonSerializationException occurred
  HResult=0x80131500
  Message=Self referencing loop detected for property 'ManifestModule' with type 'System.Reflection.RuntimeModule'. Path 'TestRunCompleteArgs.Error.TargetSite.Module.Assembly'.
  Source=<Cannot evaluate the exception source>
  StackTrace:
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CheckForCircularReference(JsonWriter writer, Object value, JsonProperty property, JsonContract contract, JsonContainerContract containerContract, JsonProperty containerProperty)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
   at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
   at Newtonsoft.Json.Linq.JToken.FromObjectInternal(Object o, JsonSerializer jsonSerializer)
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.JsonDataSerializer.SerializePayload(String messageType, Object payload) in C:\Users\samadala\src\tmp\backup\vstest-enlist-2\vstest\src\Microsoft.TestPlatform.CommunicationUtilities\JsonDataSerializer.cs:line 134
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TestRequestSender.OnTestRunAbort(ITestRunEventsHandler testRunEventsHandler, Exception exception) in C:\Users\samadala\src\tmp\backup\vstest-enlist-2\vstest\src\Microsoft.TestPlatform.CommunicationUtilities\TestRequestSender.cs:line 297
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TestRequestSender.ListenAndReportTestResults(ITestRunEventsHandler testRunEventsHandler) in C:\Users\samadala\src\tmp\backup\vstest-enlist-2\vstest\src\Microsoft.TestPlatform.CommunicationUtilities\TestRequestSender.cs:line 262
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TestRequestSender.<>c__DisplayClass17_0.<StartTestRunAndListenAndReportTestResults>b__0() in C:\Users\samadala\src\tmp\backup\vstest-enlist-2\vstest\src\Microsoft.TestPlatform.CommunicationUtilities\TestRequestSender.cs:line 198
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   

Workaround

Passing exception as null for TestRunCompleteEventArgs.

@harshjain2 harshjain2 added the bug label Mar 16, 2017
@Faizan2304 Faizan2304 self-assigned this Apr 25, 2017
@smadala smadala removed their assignment Apr 26, 2017
Faizan2304 added a commit to Faizan2304/vstest that referenced this issue May 10, 2017
1) microsoft#706
2) microsoft#618

Fix:
Don’t serialize the type if that have self-referencing loop
Faizan2304 added a commit that referenced this issue May 11, 2017
* Dont pick package from fallbackPackageFolders as we want all the packages in vstest\package folder

* Issue:
1) #706
2) #618

Fix:
Don’t serialize the type if that have self-referencing loop

* Address PR comment.

* Log the exception in EqtTrace thrown from OnDiscoveryAbort and OnTestRunAbort
@Faizan2304
Copy link
Contributor

Fixed!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants