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

Test platform crashes when there's null value in Payload messages #1628

Closed
nigurr opened this issue Jun 1, 2018 · 1 comment
Closed

Test platform crashes when there's null value in Payload messages #1628

nigurr opened this issue Jun 1, 2018 · 1 comment
Assignees
Labels

Comments

@nigurr
Copy link

nigurr commented Jun 1, 2018

When tests are being discovered/executed if the adapter sends the value as "null" in the payload, platform fails to deserialize the payload causing it crash.

For example:

   {
      "Key": {
        "Id": "VCTestDiscoverer.TestCategory",
        "Label": "TestCategory",
        "Category": "",
        "Description": "",
        "Attributes": 1,
        "ValueType": "System.String[]"
      },
      "Value": null
    },
TpTrace Verbose: 0 : 4936, 7, 2018/05/31, 17:21:44.662, 12516221489, vstest.console.exe, TestRequestSender: GetAbortErrorMessage: Exception: Newtonsoft.Json.JsonSerializationException: Error setting value to 'StoreKeyValuePairs' on 'Microsoft.VisualStudio.TestPlatform.ObjectModel.TestCase'. ---> System.NotSupportedException: CustomStringArrayConverter cannot convert from (null).
   at System.ComponentModel.TypeConverter.GetConvertFromException(Object value)
   at System.ComponentModel.TypeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at Microsoft.VisualStudio.TestPlatform.ObjectModel.CustomStringArrayConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at Microsoft.VisualStudio.TestPlatform.ObjectModel.TestObject.ConvertPropertyFrom[T](TestProperty property, CultureInfo culture, Object value)
   at Microsoft.VisualStudio.TestPlatform.ObjectModel.TestObject.SetPropertyValue[T](TestProperty property, T value, CultureInfo culture)
   at Microsoft.VisualStudio.TestPlatform.ObjectModel.TestObject.set_StoreKeyValuePairs(List`1 value)
   at SetStoreKeyValuePairs(Object , Object )
   at Newtonsoft.Json.Serialization.DynamicValueProvider.SetValue(Object target, Object value)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Serialization.DynamicValueProvider.SetValue(Object target, Object value)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at Newtonsoft.Json.Linq.JToken.ToObject[T](JsonSerializer jsonSerializer)
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.JsonDataSerializer.DeserializePayload[T](Message message)
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TestRequestSender.OnDiscoveryMessageReceived(ITestDiscoveryEventsHandler2 discoveryEventsHandler, MessageReceivedEventArgs args)
TpTrace Error: 0 : 4936, 7, 2018/05/31, 17:21:44.662, 12516225635, vstest.console.exe, TestRequestSender: Aborting test discovery because Error setting value to 'StoreKeyValuePairs' on 'Microsoft.VisualStudio.TestPlatform.ObjectModel.TestCase'.
@smadala
Copy link
Contributor

smadala commented Jun 19, 2018

This was fixed with #1640

@smadala smadala closed this as completed Jun 19, 2018
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

2 participants