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

Disable failing System.Text.Json tests on Android x86 and on Browser with threading enabled #72664

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public static partial class PlatformDetection
public static bool IsNetBSD => RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD"));
public static bool IsAndroid => RuntimeInformation.IsOSPlatform(OSPlatform.Create("ANDROID"));
public static bool IsNotAndroid => !IsAndroid;
public static bool IsNotAndroidX86 => !(IsAndroid && IsX86Process);
public static bool IsAndroidX86 => IsAndroid && IsX86Process;
public static bool IsNotAndroidX86 => !IsAndroidX86;
public static bool IsiOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS"));
public static bool IstvOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("TVOS"));
public static bool IsMacCatalyst => RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACCATALYST"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public async Task MultipleThreadsLooping()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/72101", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidX86))]
public async Task MultipleThreads()
{
// Verify the test class has >32 properties since that is a threshold for using the fallback dictionary.
Expand Down Expand Up @@ -104,6 +105,7 @@ public async Task PropertyCacheWithMinInputsFirst()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/72101", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidX86))]
public async Task PropertyCacheWithMinInputsLast()
{
// Use local options to avoid obtaining already cached metadata from the default options.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public abstract partial class ConstructorTests
{
[Fact]
[SkipOnCoreClr("https://github.com/dotnet/runtime/issues/45464", ~RuntimeConfiguration.Release)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/72101", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidX86))]
public async Task ReadSimpleObjectAsync()
{
if (StreamingSerializer is null)
Expand Down Expand Up @@ -65,6 +66,7 @@ async Task RunTestAsync<T>(byte[] testData)
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/72101", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidX86))]
public async Task ReadSimpleObjectWithTrailingTriviaAsync()
{
if (StreamingSerializer is null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public static void ExplicitOperators_FromProperties()
Assert.Equal(new Guid("1B33498A-7B7D-4DDA-9C13-F6AA4AB449A6"), (Guid)jObject["MyGuid"]);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotAndroid), nameof(PlatformDetection.IsNotX86Process))]
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/72101", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidX86))]
public static void ExplicitOperators_FromValues()
{
Assert.Equal(1, (short)(JsonNode)(short)1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public static IEnumerable<object[]> TestData(bool enumeratePayloadTweaks)
[Theory]
[MemberData(nameof(TestData), /* enumeratePayloadTweaks: */ false)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42677", platforms: TestPlatforms.Windows, runtimes: TestRuntimes.Mono)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/72101", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidX86))]
public static async Task ShouldWorkAtAnyPosition_Stream(
string json,
int bufferSize,
Expand Down Expand Up @@ -182,6 +183,7 @@ public static async Task InvalidJsonShouldFailAtAnyPosition_Stream(
[MemberData(nameof(TestData), /* enumeratePayloadTweaks: */ false)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42677", platforms: TestPlatforms.Windows, runtimes: TestRuntimes.Mono)]
[SkipOnCoreClr("https://github.com/dotnet/runtime/issues/45464", ~RuntimeConfiguration.Release)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/72101", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidX86))]
public static void ShouldWorkAtAnyPosition_Sequence(
string json,
int bufferSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ public static void Number_AsRootType_RoundTrip()
RunAsRootTypeTest(JsonNumberTestData.UInts);
RunAsRootTypeTest(JsonNumberTestData.ULongs);
RunAsRootTypeTest(JsonNumberTestData.Floats);
RunAsRootTypeTest(JsonNumberTestData.Doubles);
// https://github.com/dotnet/runtime/issues/72101
if (!PlatformDetection.IsAndroidX86)
{
RunAsRootTypeTest(JsonNumberTestData.Doubles);
}
RunAsRootTypeTest(JsonNumberTestData.Decimals);
RunAsRootTypeTest(JsonNumberTestData.NullableBytes);
RunAsRootTypeTest(JsonNumberTestData.NullableSBytes);
Expand All @@ -72,7 +76,11 @@ public static void Number_AsRootType_RoundTrip()
RunAsRootTypeTest(JsonNumberTestData.NullableUInts);
RunAsRootTypeTest(JsonNumberTestData.NullableULongs);
RunAsRootTypeTest(JsonNumberTestData.NullableFloats);
RunAsRootTypeTest(JsonNumberTestData.NullableDoubles);
// https://github.com/dotnet/runtime/issues/72101
if (!PlatformDetection.IsAndroidX86)
{
RunAsRootTypeTest(JsonNumberTestData.NullableDoubles);
}
RunAsRootTypeTest(JsonNumberTestData.NullableDecimals);
}

Expand Down Expand Up @@ -380,7 +388,11 @@ public static void Number_AsCollectionElement_RoundTrip()
RunAsCollectionElementTest(JsonNumberTestData.UInts);
RunAsCollectionElementTest(JsonNumberTestData.ULongs);
RunAsCollectionElementTest(JsonNumberTestData.Floats);
RunAsCollectionElementTest(JsonNumberTestData.Doubles);
// https://github.com/dotnet/runtime/issues/72101
if (!PlatformDetection.IsAndroidX86)
{
RunAsCollectionElementTest(JsonNumberTestData.Doubles);
}
RunAsCollectionElementTest(JsonNumberTestData.Decimals);

// https://github.com/dotnet/runtime/issues/66220
Expand All @@ -395,7 +407,11 @@ public static void Number_AsCollectionElement_RoundTrip()
RunAsCollectionElementTest(JsonNumberTestData.NullableUInts);
RunAsCollectionElementTest(JsonNumberTestData.NullableULongs);
RunAsCollectionElementTest(JsonNumberTestData.NullableFloats);
RunAsCollectionElementTest(JsonNumberTestData.NullableDoubles);
// https://github.com/dotnet/runtime/issues/72101
if (!PlatformDetection.IsAndroidX86)
{
RunAsCollectionElementTest(JsonNumberTestData.NullableDoubles);
}
RunAsCollectionElementTest(JsonNumberTestData.NullableDecimals);
}
}
Expand Down Expand Up @@ -621,7 +637,11 @@ public static void DictionariesRoundTrip()
{
RunAllDictionariessRoundTripTest(JsonNumberTestData.ULongs);
RunAllDictionariessRoundTripTest(JsonNumberTestData.Floats);
RunAllDictionariessRoundTripTest(JsonNumberTestData.Doubles);
// https://github.com/dotnet/runtime/issues/72101
if (!PlatformDetection.IsAndroidX86)
{
RunAllDictionariessRoundTripTest(JsonNumberTestData.Doubles);
}
}

private static void RunAllDictionariessRoundTripTest<T>(List<T> numbers)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace System.Text.Json.Tests
public static partial class Utf8JsonReaderTests
{
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/72101", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidX86))]
public static void TestingNumbers_TryGetMethods()
{
byte[] dataUtf8 = JsonNumberTestData.JsonData;
Expand Down Expand Up @@ -153,6 +154,7 @@ public static void TestingNumbers_TryGetMethods()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/72101", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidX86))]
public static void TestingNumbers_GetMethods()
{
byte[] dataUtf8 = JsonNumberTestData.JsonData;
Expand Down
7 changes: 7 additions & 0 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,13 @@
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.WebSockets.Client\tests\wasm\System.Net.WebSockets.Client.Wasm.Tests.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetOS)' == 'Browser' and '$(WasmEnableThreads)' == 'true' and '$(RunDisabledWasmTests)' != 'true'">
<!-- https://github.com/dotnet/runtime/issues/72101 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Tests\System.Text.Json.SourceGeneration.Roslyn3.11.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Tests\System.Text.Json.SourceGeneration.Roslyn4.0.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.Tests\System.Text.Json.Tests.csproj" />
</ItemGroup>

<!-- Aggressive Trimming related failures -->
<ItemGroup Condition="('$(TargetOS)' != 'Browser' and '$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' != 'true') or ('$(TargetOS)' == 'Browser' and '$(BuildAOTTestsOnHelix)' == 'true' and '$(RunDisabledWasmTests)' != 'true')">
</ItemGroup>
Expand Down