Skip to content

Commit

Permalink
Fixes for outerloop-mono.yml (#88743)
Browse files Browse the repository at this point in the history
Consolidate configurations and disable failing tests with ActiveIssue.
  • Loading branch information
akoeplinger authored Jul 25, 2023
1 parent 2b477ae commit 821d6cc
Show file tree
Hide file tree
Showing 19 changed files with 476 additions and 377 deletions.
59 changes: 27 additions & 32 deletions eng/pipelines/libraries/outerloop-mono.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
trigger: none

schedules:
- cron: "0 8 * * *" # 8 AM UTC => 12 AM PST
- cron: "0 8 * * 2,4" # 8 AM UTC => 12 AM PST, every Tuesday and Thursday
displayName: Outerloop scheduled build
branches:
include:
Expand All @@ -24,14 +24,14 @@ extends:
buildConfig: Release
runtimeFlavor: mono
platforms:
- windows_x86
- browser_wasm
- ${{ if eq(variables['isRollingBuild'], true) }}:
- windows_x64
- linux_x64
- linux_arm
- linux_musl_x64
- osx_x64
- ${{ if eq(variables['isRollingBuild'], true) }}:
- android_x64
- linux_arm
- linux_musl_x64
- windows_x86
jobParameters:
testScope: outerloop
nameSuffix: AllSubsets_Mono
Expand All @@ -41,34 +41,29 @@ extends:
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
extraStepsParameters:
scenarios:
- WasmTestOnBrowser
testScope: outerloop
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)

- ${{ if eq(variables['isRollingBuild'], false) }}:
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
buildConfig: Debug
runtimeFlavor: mono
platforms:
- windows_x64
- linux_x64
- linux_musl_x64
- osx_x64
- android_arm64
jobParameters:
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
buildConfig: Release
runtimeFlavor: mono
platforms:
- browser_wasm
jobParameters:
testScope: outerloop
nameSuffix: AllSubsets_Mono
buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) -testscope outerloop /p:ArchiveTests=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS)
timeoutInMinutes: 180
includeAllPlatforms: ${{ variables['isRollingBuild'] }}
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
extraStepsParameters:
scenarios:
- normal
testScope: outerloop
nameSuffix: AllSubsets_Mono
buildArgs: -s mono+host.native+libs+libs.tests -c $(_BuildConfig) -testscope outerloop /p:ArchiveTests=true
timeoutInMinutes: 180
includeAllPlatforms: ${{ variables['isRollingBuild'] }}
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
extraStepsParameters:
testScope: outerloop
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
4 changes: 2 additions & 2 deletions eng/pipelines/libraries/outerloop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extends:
- osx_x64
jobParameters:
testScope: outerloop
nameSuffix: CoreCLR_Release
nameSuffix: CoreCLR_$(_BuildConfig)
buildArgs: -s clr+host.native+libs+libs.tests -lc $(_BuildConfig) -hc $(_BuildConfig) -rc Release -testscope outerloop /p:ArchiveTests=true
timeoutInMinutes: 180
includeAllPlatforms: ${{ variables['isRollingBuild'] }}
Expand Down Expand Up @@ -68,7 +68,7 @@ extends:
- osx_x64
jobParameters:
testScope: outerloop
nameSuffix: CoreCLR_Release
nameSuffix: CoreCLR_$(_BuildConfig)
buildArgs: -s clr+host.native+libs+libs.tests -lc $(_BuildConfig) -hc $(_BuildConfig) -rc Release -testscope outerloop /p:ArchiveTests=true
timeoutInMinutes: 180
includeAllPlatforms: ${{ variables['isRollingBuild'] }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using Xunit;

[assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/88992", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.IsX86Process))]
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<Compile Include="..\src\System\Diagnostics\Metrics\StringSequence.cs" Link="StringSequence.cs" />
<Compile Include="..\src\System\Diagnostics\Metrics\StringSequence.netcore.cs" Link="StringSequence.netcore.cs" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" />
<Compile Include="..\src\System\Diagnostics\Metrics\StringSequence.netfx.cs" Link="StringSequence.netfx.cs" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="AggregationManagerTests.cs" />
<Compile Include="ExponentialHistogramTests.cs" />
<Compile Include="DiagnosticSourceTests.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using Xunit;

[assembly: SkipOnCoreClr("System.Net.Tests are flaky and/or long running: https://github.com/dotnet/runtime/issues/131", ~RuntimeConfiguration.Release)]
[assembly: SkipOnPlatform(TestPlatforms.Browser, "System.Net.Sockets is not supported on Browser")]
[assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/88992", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.IsX86Process))]
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Buffers;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -847,7 +848,7 @@ public void SetBufferMemory_NonArray_BufferReturnsNull()
}

[OuterLoop("Involves GC and finalization")]
[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))]
[InlineData(false)]
[InlineData(true)]
public void Finalizer_InvokedWhenNoLongerReferenced(bool afterAsyncOperation)
Expand Down
7 changes: 7 additions & 0 deletions src/libraries/System.Runtime.Caching/tests/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using Xunit;

[assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/88992", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.IsX86Process))]
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<EventSourceSupport>true</EventSourceSupport>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="AdditionalCacheTests\AdditionalCacheTests.cs" />
<Compile Include="Common\PokerChangeMonitor.cs" />
<Compile Include="Common\PokerMemoryCache.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using Xunit;

[assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/88992", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsWindows), nameof(PlatformDetection.IsX86Process))]
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="CheckArchitectureTests.cs" />
<Compile Include="CheckPlatformTests.cs" />
<Compile Include="RuntimeIdentifierTests.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Text.Encodings.Web;
using System.Text.Unicode;
using Microsoft.DotNet.XUnitExtensions;
using Xunit;

namespace System.Text.Json.Tests
Expand Down Expand Up @@ -235,7 +236,7 @@ public static void ToStringLargeTest(int stringLength)
}
{
var message = new string('>', stringLength);
var builder = new StringBuilder();
var builder = new StringBuilder(stringLength);
for (int i = 0; i < stringLength; i++)
{
builder.Append("\\u003E");
Expand Down Expand Up @@ -302,7 +303,7 @@ public static void GetUtf8BytesLargeTest(int stringLength)
}
{
var message = new string('>', stringLength);
var builder = new StringBuilder();
var builder = new StringBuilder(stringLength);
for (int i = 0; i < stringLength; i++)
{
builder.Append("\\u003E");
Expand Down Expand Up @@ -362,7 +363,7 @@ public static void GetValueLargeTest(int stringLength)
public static void GetValueLargeEscapedTest(int stringLength)
{
var message = new string('>', stringLength);
var builder = new StringBuilder();
var builder = new StringBuilder(stringLength);
for (int i = 0; i < stringLength; i++)
{
builder.Append("\\u003E");
Expand Down Expand Up @@ -426,7 +427,7 @@ public static void InvalidLargeEncode()
}
catch (OutOfMemoryException)
{
return;
throw new SkipTestException("Out of memory allocating large objects");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Linq;
using System.Text.Encodings.Web;
using System.Text.Json.Tests;
using Microsoft.DotNet.XUnitExtensions;
using Xunit;

namespace System.Text.Json.Serialization.Tests
Expand Down Expand Up @@ -161,42 +162,49 @@ public static void WriteObjectWithNumberHandling()
[OuterLoop]
public static void SerializeLargeListOfObjects()
{
Dto dto = new()
{
Prop1 = int.MaxValue,
Prop2 = int.MinValue,
Prop3 = "AC",
Prop4 = 500,
Prop5 = int.MaxValue / 2,
Prop6 = 250M,
Prop7 = 250M,
Prop8 = 250M,
Prop9 = 250M,
Prop10 = 250M,
Prop11 = 150M,
Prop12 = 150M,
Prop13 = DateTimeOffset.MaxValue,
Prop14 = DateTimeOffset.MaxValue,
Prop15 = DateTimeOffset.MaxValue,
Prop16 = DateTimeOffset.MaxValue,
Prop17 = 3,
Prop18 = DateTime.MaxValue,
Prop19 = DateTime.MaxValue,
Prop20 = 25000,
Prop21 = DateTime.MaxValue
};

// It takes a little over 4,338,000 items to reach a payload size above the Array.MaxLength value.
List<Dto> items = Enumerable.Repeat(dto, 4_338_000).ToList();

try
{
JsonSerializer.SerializeToUtf8Bytes(items);
Dto dto = new()
{
Prop1 = int.MaxValue,
Prop2 = int.MinValue,
Prop3 = "AC",
Prop4 = 500,
Prop5 = int.MaxValue / 2,
Prop6 = 250M,
Prop7 = 250M,
Prop8 = 250M,
Prop9 = 250M,
Prop10 = 250M,
Prop11 = 150M,
Prop12 = 150M,
Prop13 = DateTimeOffset.MaxValue,
Prop14 = DateTimeOffset.MaxValue,
Prop15 = DateTimeOffset.MaxValue,
Prop16 = DateTimeOffset.MaxValue,
Prop17 = 3,
Prop18 = DateTime.MaxValue,
Prop19 = DateTime.MaxValue,
Prop20 = 25000,
Prop21 = DateTime.MaxValue
};

// It takes a little over 4,338,000 items to reach a payload size above the Array.MaxLength value.
List<Dto> items = Enumerable.Repeat(dto, 4_338_000).ToList();

try
{
JsonSerializer.SerializeToUtf8Bytes(items);
}
catch (OutOfMemoryException) { }

items.AddRange(Enumerable.Repeat(dto, 1000).ToList());
Assert.Throws<OutOfMemoryException>(() => JsonSerializer.SerializeToUtf8Bytes(items));
}
catch (OutOfMemoryException)
{
throw new SkipTestException("Out of memory allocating large objects");
}
catch (OutOfMemoryException) { }

items.AddRange(Enumerable.Repeat(dto, 1000).ToList());
Assert.Throws<OutOfMemoryException>(() => JsonSerializer.SerializeToUtf8Bytes(items));
}

class Dto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Globalization;
using System.Runtime.CompilerServices;
using Microsoft.DotNet.XUnitExtensions;
using Newtonsoft.Json;
using Xunit;

Expand Down Expand Up @@ -453,8 +454,15 @@ public static void LongInputString(int length)
[OuterLoop]
public static void VeryLongInputString(int length)
{
// Verify that deserializer does not do any multiplication or addition on the string length
DeserializeLongJsonString(length);
try
{
// Verify that deserializer does not do any multiplication or addition on the string length
DeserializeLongJsonString(length);
}
catch (OutOfMemoryException)
{
throw new SkipTestException("Out of memory allocating large objects");
}
}

private static void DeserializeLongJsonString(int stringLength)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3038,7 +3038,7 @@ public static void JsonContainingOnlyCommentsIsInvalid(string jsonString, int ex
[MemberData(nameof(LotsOfCommentsTests))]
public static void SkipLotsOfComments(string valueString, bool insideArray, string expectedString)
{
var builder = new StringBuilder();
var builder = new StringBuilder(2_000_000);
if (insideArray)
{
builder.Append("[");
Expand Down Expand Up @@ -3116,7 +3116,7 @@ public static void SkipLotsOfComments(string valueString, bool insideArray, stri
[MemberData(nameof(LotsOfCommentsTests))]
public static void ConsumeLotsOfComments(string valueString, bool insideArray, string expectedString)
{
var builder = new StringBuilder();
var builder = new StringBuilder(2_000_000);
if (insideArray)
{
builder.Append("[");
Expand Down
Loading

0 comments on commit 821d6cc

Please sign in to comment.