Repository navigation
Closed
Description
Based on the library tests run in #59503, we've got several failing tests in System.Runtime.Serialization.Xml.ReflectionOnly.Tests/System.Runtime.Serialization.Json.ReflectionOnly.Tests.log:
- DataContractSerializerTests.DCS_BasicRoundTripResolveDTOTypes
- DataContractSerializerTests.DCS_TypeWithDatetimeOffsetTypeProperty
- DataContractSerializerTests.DCS_TypeWithKnownTypeAttributeAndListOfInterfaceMember
- DataContractSerializerTests.DCS_BasicPerSerializerRoundTripAndCompare_EnumStruct_NotNetFramework
- DataContractSerializerTests.DCS_DerivedTypeWithDifferentOverrides
- DataContractSerializerTests.DCS_DuplicatedKeyDateTimeOffset
- DataContractSerializerTests.DCS_DuplicatedKnownTypesWithAdapterThroughConstructor
- DataContractSerializerTests.DCS_SerializeClassThatImplementsInteface
- DataContractSerializerTests.DCS_TypeWithVirtualGenericProperty
- DataContractSerializerTests.DCS_TypeWithCollectionAndDateTimeOffset_ListIsNull
- DataContractSerializerTests.DCS_BasicRoundTripResolvePrimitiveTypes_NotNetFramework
- DataContractSerializerTests.DCS_BasicPerSerializerRoundTripAndCompare_SampleTypes
- DataContractSerializerTests.DCS_BasicPerSerializerRoundTripAndCompare_EnumStruct
- DataContractSerializerTests.DCS_TypeWithCollectionAndDateTimeOffset
- DataContractSerializerTests.DCS_DateTimeOffsetAsRoot
- DataContractSerializerTests.DCS_TypeWithKnownTypeAttributeAndInterfaceMember
- DataContractJsonSerializerTests.DCJS_TypeWithKnownTypeAttributeAndInterfaceMember
- DataContractJsonSerializerTests.DCJS_TypeWithKnownTypeAttributeAndListOfInterfaceMember
- DataContractJsonSerializerTests.DCJS_VerifyDateTimeForFormatStringDCJsonSerSettings
- DataContractJsonSerializerTests.DCJS_ClassWithDatetimeOffsetTypeProperty
- XmlSerializerTests.DerivedTypeWithDifferentOverrides
- XmlSerializerTests.DerivedTypeWithDifferentOverrides2
The error message is
<failure exception-type="System.ExecutionEngineException">
<message><![CDATA[System.ExecutionEngineException : Attempting to JIT compile method '(wrapper delegate-invoke) System.DateTime <Module>:invoke_callvirt_DateTime_DateTimeOffsetAdapter& (System.Runtime.Serialization.DateTimeOffsetAdapter&)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.\n]]></message>
<stack-trace><![CDATA[ at System.Runtime.Serialization.FastInvokerBuilder.<>c__DisplayClass11_0`2[[System.Runtime.Serialization.DateTimeOffsetAdapter, System.Private.DataContractSerialization, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.DateTime, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<CreateGetterInternal>b__2(Object obj)
at System.Runtime.Serialization.ReflectionClassWriter.ReflectionGetMemberValue(Object obj, DataMember dataMember)
at System.Runtime.Serialization.ReflectionXmlClassWriter.ReflectionWriteMembers(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context, ClassDataContract classContract, ClassDataContract derivedMostClassContract, Int32 childElementIndex, XmlDictionaryString[] emptyStringArray)
at System.Runtime.Serialization.ReflectionClassWriter.ReflectionWriteClass(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context, ClassDataContract classContract, XmlDictionaryString[] memberNames)
at System.Runtime.Serialization.ReflectionXmlFormatWriter.ReflectionWriteClass(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context, ClassDataContract classContract)
at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
at System.Runtime.Serialization.ReflectionClassWriter.ReflectionInternalSerialize(XmlWriterDelegator xmlWriter, XmlObjectSerializerWriteContext context, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Type memberType, Boolean isNullableOfT)
at System.Runtime.Serialization.ReflectionClassWriter.ReflectionWriteValue(XmlWriterDelegator xmlWriter, XmlObjectSerializerWriteContext context, Type type, Object value, Boolean writeXsiType, PrimitiveDataContract primitiveContractForParamType)
at System.Runtime.Serialization.ReflectionXmlClassWriter.ReflectionWriteMembers(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context, ClassDataContract classContract, ClassDataContract derivedMostClassContract, Int32 childElementIndex, XmlDictionaryString[] emptyStringArray)
at System.Runtime.Serialization.ReflectionClassWriter.ReflectionWriteClass(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context, ClassDataContract classContract, XmlDictionaryString[] memberNames)
at System.Runtime.Serialization.ReflectionXmlFormatWriter.ReflectionWriteClass(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context, ClassDataContract classContract)
at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
at System.Runtime.Serialization.ReflectionClassWriter.ReflectionInternalSerialize(XmlWriterDelegator xmlWriter, XmlObjectSerializerWriteContext context, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Type memberType, Boolean isNullableOfT)
at System.Runtime.Serialization.ReflectionClassWriter.ReflectionWriteValue(XmlWriterDelegator xmlWriter, XmlObjectSerializerWriteContext context, Type type, Object value, Boolean writeXsiType, PrimitiveDataContract primitiveContractForParamType)
at System.Runtime.Serialization.ReflectionXmlClassWriter.ReflectionWriteMembers(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context, ClassDataContract classContract, ClassDataContract derivedMostClassContract, Int32 childElementIndex, XmlDictionaryString[] emptyStringArray)
at System.Runtime.Serialization.ReflectionClassWriter.ReflectionWriteClass(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context, ClassDataContract classContract, XmlDictionaryString[] memberNames)
at System.Runtime.Serialization.ReflectionXmlFormatWriter.ReflectionWriteClass(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context, ClassDataContract classContract)
at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObject(XmlDictionaryWriter writer, Object graph)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObject(Stream stream, Object graph)
at System.Runtime.Serialization.Tests.DataContractSerializerHelper.SerializeAndDeserialize[ObjectContainer](ObjectContainer value, String baseline, DataContractSerializerSettings settings, Func`1 serializerFactory, Boolean skipStringCompare)
at DataContractSerializerTests.DCS_BasicRoundTripResolveDTOTypes()
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)]]></stack-trace>
</failure>
Activity
HongGit commentedon Jan 13, 2022
This is likely to be fixed in PR #60811. Feel free to reactive if the issue persists.
MaximLipnin commentedon Jan 14, 2022
The issue still persists, re-opening it.
MaximLipnin commentedon Jan 14, 2022
https://dev.azure.com/dnceng/public/_build/results?buildId=1552655&view=ms.vss-test-web.build-test-results-tab&runId=43811632&resultId=131261&paneView=dotnet-dnceng.dnceng-anon-build-release-tasks.helix-anon-test-information-tab
StephenMolloy commentedon Aug 4, 2025
I think this is fixed now.
MichalStrehovsky commentedon Aug 5, 2025
There are tests blocked on this bug in the repo. Please submit a PR unblocking it and resolve the issue with that.
StephenMolloy commentedon Aug 6, 2025
I'm putting together a PR to re-enable a bunch of serializer tests that have been disabled over the years and forgotten about. I haven't seen any evidence that these tests are still failing. I believe these tests should be fine without dynamic code. But I don't have an ios machine for testing. Is there a way to trigger an azure pipeline or some other way to verify these tests don't fail in this configuration before merging the PR that re-enables serializer tests?
MichalStrehovsky commentedon Aug 6, 2025
I think
/azp run runtime-extra-platformswould run the libraries tests on tvOS. (@kotlarmilos please correct me if I'm wrong.)kotlarmilos commentedon Aug 6, 2025
Yes, also
/azp run runtime-ioslikefor Apple mobile tests only.StephenMolloy commentedon Aug 19, 2025
I have re-enabled a bunch of serialization tests in PRs #118507 and #118628.
Per these runs (1118444, 1118071, 1121050, 1121056), none of these testcases are failing anymore.