ch-robinson / dotnet-avro

An Avro implementation for .NET
https://engineering.chrobinson.com/dotnet-avro/
MIT License
132 stars 49 forks source link

JSON test failures under NetCore 3.1 #270

Closed fabianoliver closed 10 months ago

fabianoliver commented 10 months ago

When running Chr.Avro.Json.Tests using TargetFramework netcoreapp3.1, three unit tests fail. Unless that's any test-specific issue, that might mean Chr.Avro.Json might have issues with some .netstandard2 compatible .Net versions.

[xUnit.net 00:00:00.88]     Chr.Avro.Abstract.Tests.JsonDefaultValueShould.UseFirstChildOfUnionSchema [FAIL]
[xUnit.net 00:00:00.88]     Chr.Avro.Abstract.Tests.JsonDefaultValueShould.ConvertValueToObject [FAIL]
  Failed Chr.Avro.Abstract.Tests.JsonDefaultValueShould.UseFirstChildOfUnionSchema [7 ms]
  Error Message:
   System.Text.Json.JsonException : The JSON value could not be converted to System.Text.Json.JsonDocument. Path: $ | LineNumber: 0 | BytePositionInLine: 1.
  Stack Trace:
     at System.Text.Json.ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type propertyType)
   at System.Text.Json.JsonPropertyInfoNotNullable`4.OnRead(ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.JsonPropertyInfo.Read(JsonTokenType tokenType, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
   at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader& reader)
   at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options)
   at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
   at Chr.Avro.Abstract.Tests.JsonDefaultValueShould.UseFirstChildOfUnionSchema() in C:\src\avro\dotnet-avro\tests\Chr.Avro.Json.Tests\JsonDefaultValueShould.cs:line 34
  Failed Chr.Avro.Abstract.Tests.JsonDefaultValueShould.ConvertValueToObject [< 1 ms]
  Error Message:
   System.Text.Json.JsonException : The JSON value could not be converted to System.Text.Json.JsonDocument. Path: $ | LineNumber: 0 | BytePositionInLine: 1.
  Stack Trace:
     at System.Text.Json.ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type propertyType)
   at System.Text.Json.JsonPropertyInfoNotNullable`4.OnRead(ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.JsonPropertyInfo.Read(JsonTokenType tokenType, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
   at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader& reader)
   at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options)
   at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
   at Chr.Avro.Abstract.Tests.JsonDefaultValueShould.ConvertValueToObject() in C:\src\avro\dotnet-avro\tests\Chr.Avro.Json.Tests\JsonDefaultValueShould.cs:line 12
[xUnit.net 00:00:00.88]     Chr.Avro.Abstract.Tests.JsonDefaultValueShould.ThrowWhenConstructedWithNullSchema [FAIL]
  Failed Chr.Avro.Abstract.Tests.JsonDefaultValueShould.ThrowWhenConstructedWithNullSchema [< 1 ms]
  Error Message:
   System.Text.Json.JsonException : The JSON value could not be converted to System.Text.Json.JsonDocument. Path: $ | LineNumber: 0 | BytePositionInLine: 1.
  Stack Trace:
     at System.Text.Json.ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type propertyType)
   at System.Text.Json.JsonPropertyInfoNotNullable`4.OnRead(ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.JsonPropertyInfo.Read(JsonTokenType tokenType, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
   at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader& reader)
   at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options)
   at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
   at Chr.Avro.Abstract.Tests.JsonDefaultValueShould.ThrowWhenConstructedWithNullSchema() in C:\src\avro\dotnet-avro\tests\Chr.Avro.Json.Tests\JsonDefaultValueShould.cs:line 25

Failed!  - Failed:     3, Passed:   363, Skipped:     0, Total:   366, Duration: 180 ms - Chr.Avro.Json.Tests.dll (netcoreapp3.1)