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

[NativeAOT] Tests failing due to TypeInfoResolver not providing JsonTypeInfo metadata for a type #88982

Closed
ivanpovazan opened this issue Jul 17, 2023 · 5 comments · Fixed by #89105
Assignees
Labels
area-System.Text.Json blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' blocking-release Known Build Error Use this to report build issues in the .NET Helix tab
Milestone

Comments

@ivanpovazan
Copy link
Member

ivanpovazan commented Jul 17, 2023

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=341298

Observed in runtime-extra-platforms pipeline

Build error legs:

  • net8.0-windows-Release-x64-NativeAOT_Release-(Windows.Nano.1809.Amd64.Open)
  • net8.0-windows-Release-x64-NativeAOT_Release-Windows.11.Amd64.Client.Open
  • net8.0-windows-Release-x64-NativeAOT_Release-Windows.Amd64.Server2022.Open
  • net8.0-windows-Release-x64-NativeAOT_Release-Windows.81.Amd64.Open
  • net8.0-linux-Release-arm64-NativeAOT_Release-(Debian.11.Arm64.Open)
  • net8.0-linux-Release-arm64-NativeAOT_Release-(Ubuntu.1804.Arm64.Open)

Tests failing:

  • System.Net.Http.Json.Functional.Tests.*
  • System.Text.Json.SourceGeneration.Tests.*

Pull request: #88723

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "System.NotSupportedException : JsonTypeInfo metadata for type",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=341298
Error message validated: System.NotSupportedException : JsonTypeInfo metadata for type
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 7/17/2023 7:42:58 AM UTC

Report

Build Definition Test Pull Request
343204 dotnet/runtime System.Text.Json.SourceGeneration.Tests.UnsupportedTypesTests_Metadata.DeserializeUnsupportedType<Nullable>(wrapper: 123)
342556 dotnet/runtime System.Text.Json.SourceGeneration.Tests.RequiredKeywordTests_SourceGen.ClassWithRequiredKeywordAndSmallParametrizedCtorFailsDeserialization
342345 dotnet/runtime System.Text.Json.SourceGeneration.Tests.ReferenceHandlerTests_IgnoreCycles_Default_AsyncStream.IgnoreCycles_DoesNotSupportPreserveSemantics #88974
341622 dotnet/runtime System.Text.Json.SourceGeneration.Tests.ReferenceHandlerTests_IgnoreCycles_Default_String.IgnoreCycles_DoesNotSupportPreserveSemantics_Polymorphic
341305 dotnet/runtime System.Text.Json.SourceGeneration.Tests.ReferenceHandlerTests_IgnoreCycles_Default_AsyncStream.IgnoreCycles_DoesNotSupportPreserveSemantics
341298 dotnet/runtime System.Text.Json.SourceGeneration.Tests.ReferenceHandlerTests_IgnoreCycles_Default_String.IgnoreCycles_DoesNotSupportPreserveSemantics_Polymorphic #88723
341220 dotnet/runtime System.Text.Json.SourceGeneration.Tests.ReferenceHandlerTests_IgnoreCycles_Default_String.IgnoreCycles_DoesNotSupportPreserveSemantics_Polymorphic #87847
341209 dotnet/runtime System.Text.Json.SourceGeneration.Tests.ReferenceHandlerTests_IgnoreCycles_Metadata_AsyncStream.IgnoreCycles_DoesNotSupportPreserveSemantics #88163
341090 dotnet/runtime System.Text.Json.SourceGeneration.Tests.RequiredKeywordTests_SourceGen.ClassWithRequiredKeywordAndLargeParametrizedCtorFailsDeserialization

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
3 9 9
@ivanpovazan ivanpovazan added blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' area-NativeAOT-coreclr Known Build Error Use this to report build issues in the .NET Helix tab labels Jul 17, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 17, 2023
@ghost
Copy link

ghost commented Jul 17, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=341298

Observed in runtime-extra-platforms pipeline

Build error legs:

  • net8.0-windows-Release-x64-NativeAOT_Release-(Windows.Nano.1809.Amd64.Open)
  • net8.0-windows-Release-x64-NativeAOT_Release-Windows.11.Amd64.Client.Open
  • net8.0-windows-Release-x64-NativeAOT_Release-Windows.Amd64.Server2022.Open
  • net8.0-windows-Release-x64-NativeAOT_Release-Windows.81.Amd64.Open

Tests failing:

  • System.Net.Http.Json.Functional.Tests.*
  • System.Text.Json.SourceGeneration.Tests.*

Pull request: #88723

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "System.NotSupportedException : JsonTypeInfo metadata for type",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}
Author: ivanpovazan
Assignees: -
Labels:

blocking-clean-ci, area-NativeAOT-coreclr, Known Build Error

Milestone: -

@ghost
Copy link

ghost commented Jul 17, 2023

Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis
See info in area-owners.md if you want to be subscribed.

Issue Details

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=341298

Observed in runtime-extra-platforms pipeline

Build error legs:

  • net8.0-windows-Release-x64-NativeAOT_Release-(Windows.Nano.1809.Amd64.Open)
  • net8.0-windows-Release-x64-NativeAOT_Release-Windows.11.Amd64.Client.Open
  • net8.0-windows-Release-x64-NativeAOT_Release-Windows.Amd64.Server2022.Open
  • net8.0-windows-Release-x64-NativeAOT_Release-Windows.81.Amd64.Open

Tests failing:

  • System.Net.Http.Json.Functional.Tests.*
  • System.Text.Json.SourceGeneration.Tests.*

Pull request: #88723

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "System.NotSupportedException : JsonTypeInfo metadata for type",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}
Author: ivanpovazan
Assignees: -
Labels:

area-System.Text.Json, blocking-clean-ci, untriaged, Known Build Error

Milestone: -

@ivanpovazan ivanpovazan added this to the 8.0.0 milestone Jul 17, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jul 17, 2023
@eiriktsarpalis
Copy link
Member

Likely caused by #88480. It suggests that some of the source gen tests are still using reflection serialization.

@eiriktsarpalis eiriktsarpalis self-assigned this Jul 17, 2023
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 18, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 18, 2023
@am11
Copy link
Member

am11 commented Jul 23, 2023

@eiriktsarpalis, this is still showing up in the latest run of runtime-extra-platforms:

[FAIL] System.Tests.BinaryDataTests.IsBinaryDataMemberPropertySerialized
System.NotSupportedException : JsonTypeInfo metadata for type 'System.Tests.BinaryDataTests+TestModelWithBinaryDataProperty' was not provided by TypeInfoResolver of type '[]'. If using source generation, ensure that all root types passed to the serializer have been annotated with 'JsonSerializableAttribute', along with any types that might be serialized polymorphically.
   at System.Text.Json.ThrowHelper.ThrowNotSupportedException_NoMetadataForType(Type, IJsonTypeInfoResolver) + 0x65
   at System.Text.Json.JsonSerializerOptions.GetTypeInfoInternal(Type, Boolean, Nullable`1, Boolean, Boolean) + 0xa5
   at System.Text.Json.JsonSerializerOptions.GetTypeInfoForRootType(Type, Boolean) + 0x62
   at System.Text.Json.JsonSerializer.GetTypeInfo[T](JsonSerializerOptions) + 0x25
   at System.Tests.BinaryDataTests.IsBinaryDataMemberPropertySerialized() + 0x110
   at System.Memory.Data.Tests!<BaseAddress>+0x3bcc34
   at System.Reflection.DynamicInvokeInfo.Invoke(Object, IntPtr, Object[], BinderBundle, Boolean) + 0xb3
[FAIL] System.Tests.BinaryDataTests.IsBinaryDataMemberPropertyDeserialized
System.NotSupportedException : JsonTypeInfo metadata for type 'System.Tests.BinaryDataTests+TestModelWithBinaryDataProperty' was not provided by TypeInfoResolver of type '[]'. If using source generation, ensure that all root types passed to the serializer have been annotated with 'JsonSerializableAttribute', along with any types that might be serialized polymorphically.
   at System.Text.Json.ThrowHelper.ThrowNotSupportedException_NoMetadataForType(Type, IJsonTypeInfoResolver) + 0x65
   at System.Text.Json.JsonSerializerOptions.GetTypeInfoInternal(Type, Boolean, Nullable`1, Boolean, Boolean) + 0xa5
   at System.Text.Json.JsonSerializerOptions.GetTypeInfoForRootType(Type, Boolean) + 0x62
   at System.Text.Json.JsonSerializer.GetTypeInfo[T](JsonSerializerOptions) + 0x25
   at System.Text.Json.JsonSerializer.Deserialize[TValue](String, JsonSerializerOptions) + 0x28
   at System.Tests.BinaryDataTests.IsBinaryDataMemberPropertyDeserialized() + 0xee
   at System.Memory.Data.Tests!<BaseAddress>+0x3bcc34
   at System.Reflection.DynamicInvokeInfo.Invoke(Object, IntPtr, Object[], BinderBundle, Boolean) + 0xb3

(can use /azp run runtime-extra-platforms in PR to start it on-demand)

@eiriktsarpalis
Copy link
Member

I'm guessing that test project also has a dependency on reflection STJ cc @dotnet/area-system-memory

@ghost ghost locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Text.Json blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' blocking-release Known Build Error Use this to report build issues in the .NET Helix tab
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants