Skip to content

Commit

Permalink
[browser][MT] enable all MT library tests on the runtime CI pipeline (#…
Browse files Browse the repository at this point in the history
…91536)

* Non-smoke MT tests.

* Disable tests: System.Timer, Threading, Local

* System.Threading.Tasks is mostly fleaky, cannot block one by one.

* Threading.Task.Parallel - ParallelForeachPartitioner and ParallelForTests are fleaky, cannot define which tests fail, blocking suspicious ones.

* No tests can be run in MT.

* Fails even when no tests enabled.

* System.Runtime disable failing tests.

* To be reverted! Apply tmp dev speedup suggested.

* System.Runtime.Serialization.Xml.Tests disabled.

* System.Runtime.Extensions.Tests disabled.

* System.Private.Xml.Tests disabled.

* System.Linq.Parallel.Tests disabled.

* ystem.IO.Pipelines.Tests disabled

* System.Globalization.Tests disabled.

* System.Composition.Tests disabled.

* System.ComponentModel.TypeConverter.Tests disabled.

* System.Collections.NonGeneric.Tests disabled.

* System.Collections.Concurrent.Tests cannot define which tests are failing, disable full project.

* Microsoft.Extensions.Logging.Console.Tests disabled.

* Microsoft.Extensions.Http.Tests disabled.

* Microsoft.Extensions.HostFactoryResolver.Tests disabled.

* Microsoft.Extensions.Configuration.Functional.Tests disabled.

* Microsoft.Extensions.Configuration.EnvironmentVariables.Tests disabled.

* Disable samples on mt.

* For non-mt it should stay excluded.

* Revert ab5472c

* Fix a copy-paste error.

* Default: only smoke.

* Duplicated job suffix, after disabling failing tests we should fail on error.

* Feedback - revert shouldContinueOnError removal.
  • Loading branch information
ilonatommy authored Sep 13, 2023
1 parent 9c985a9 commit 7eb6c0c
Show file tree
Hide file tree
Showing 56 changed files with 281 additions and 18 deletions.
18 changes: 1 addition & 17 deletions eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,6 @@ jobs:
- WasmTestOnBrowser
- WasmTestOnNodeJS

# Smoke tests only with full threading
- template: /eng/pipelines/common/templates/wasm-library-tests.yml
parameters:
platforms:
- browser_wasm
#- browser_wasm_win
nameSuffix: _Threading_Smoke
extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:WasmEnableThreads=true /p:_WasmPThreadPoolSize=8 /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS)
shouldRunSmokeOnly: true
isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }}
# Always run for runtime-wasm because browser testing is not on runtime
alwaysRun: ${{ parameters.isWasmOnlyBuild }}
scenarios:
- WasmTestOnBrowser

# Library tests with full threading
- template: /eng/pipelines/common/templates/wasm-library-tests.yml
parameters:
Expand All @@ -134,7 +118,7 @@ jobs:
# Always run for runtime-wasm because tests are not run in runtime
alwaysRun: ${{ parameters.isWasmOnlyBuild }}

# NOTE - Since threading is experimental, we don't want to block mainline work
# NOTE - Since threading is experimental, we don't want to block mainline work
shouldContinueOnError: true
scenarios:
- WasmTestOnBrowser
Expand Down
2 changes: 2 additions & 0 deletions src/libraries/Common/tests/System/TimeProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public static IEnumerable<object[]> TimersProvidersData()
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
[MemberData(nameof(TimersProvidersData))]
public void TestProviderTimer(TimeProvider provider, int MaxMilliseconds)
{
Expand Down Expand Up @@ -215,6 +216,7 @@ private static void CancelAfter(TimeProvider provider, CancellationTokenSource c
#endif // NETFRAMEWORK

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
[MemberData(nameof(TimersProvidersListData))]
public static void CancellationTokenSourceWithTimer(TimeProvider provider)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ public void AddEnvironmentVariablesUsingPrefixWithDoubleUnderscores_Bind_PrefixM
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void BindingDoesNotThrowIfReloadedDuringBinding()
{
var dic = new Dictionary<string, string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ public void LoadAndCombineKeyValuePairsFromDifferentConfigurationProvidersWithAb
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void CanOverrideValuesWithNewConfigurationProvider()
{
WriteTestFiles();
Expand Down Expand Up @@ -940,6 +941,7 @@ await WaitForChange(
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void BindingDoesNotThrowIfReloadedDuringBinding()
{
WriteTestFiles();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ public void ApplicationNameSetFromArgument()
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void NoSpecialEntryPointPatternCanRunInParallel()
{
var factory = HostFactoryResolver.ResolveServiceProviderFactory(typeof(NoSpecialEntryPointPattern.Program).Assembly, s_WaitTimeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,7 @@ public async Task AddHttpClient_MessageHandler_Scope_TransientDependency()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void AddHttpClient_GetAwaiterAndResult_InSingleThreadedSynchronizationContext_ShouldNotHangs()
{
// Arrange
Expand Down Expand Up @@ -1367,6 +1368,7 @@ public void SuppressScope_True_InScope_DoesNotCreateScope()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91673", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void AddHttpClient_ConfigurePrimaryHttpMessageHandler_ApplyChangesPrimaryHandler()
{
// Arrange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ internal static (ConsoleLogger Logger, ConsoleSink Sink, ConsoleSink ErrorSink,
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void ConsoleLoggerOptions_TimeStampFormat_IsReloaded()
{
// Arrange
Expand All @@ -87,6 +88,7 @@ public void ConsoleLoggerOptions_TimeStampFormat_IsReloaded()
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
[MemberData(nameof(FormatterNames))]
public void InvalidLogLevel_Throws(string formatterName)
{
Expand All @@ -101,6 +103,7 @@ public void InvalidLogLevel_Throws(string formatterName)
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
[MemberData(nameof(FormatterNamesAndLevels))]
public void NoMessageOrException_Noop(string formatterName, LogLevel level)
{
Expand All @@ -120,6 +123,7 @@ public void NoMessageOrException_Noop(string formatterName, LogLevel level)
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
[MemberData(nameof(FormatterNamesAndLevels))]
public void Log_LogsCorrectTimestamp(string formatterName, LogLevel level)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public void AddConsoleFormatter_NullConfigure_Throws()
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
[MemberData(nameof(FormatterNames))]
public void AddConsole_ConsoleLoggerOptionsFromConfigFile_IsReadFromLoggingConfiguration(string formatterName)
{
Expand Down Expand Up @@ -155,6 +156,7 @@ private class CustomOptions : ConsoleFormatterOptions
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void AddSimpleConsole_ChangeProperties_IsReadFromLoggingConfiguration()
{
var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
Expand Down Expand Up @@ -185,6 +187,7 @@ public void AddSimpleConsole_ChangeProperties_IsReadFromLoggingConfiguration()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void AddSimpleConsole_OutsideConfig_TakesProperty()
{
var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
Expand Down Expand Up @@ -215,6 +218,7 @@ public void AddSimpleConsole_OutsideConfig_TakesProperty()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void AddSystemdConsole_ChangeProperties_IsReadFromLoggingConfiguration()
{
var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
Expand All @@ -241,6 +245,7 @@ public void AddSystemdConsole_ChangeProperties_IsReadFromLoggingConfiguration()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void AddSystemdConsole_OutsideConfig_TakesProperty()
{
var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
Expand Down Expand Up @@ -271,6 +276,7 @@ public void AddSystemdConsole_OutsideConfig_TakesProperty()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void AddJsonConsole_ChangeProperties_IsReadFromLoggingConfiguration()
{
var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
Expand Down Expand Up @@ -299,6 +305,7 @@ public void AddJsonConsole_ChangeProperties_IsReadFromLoggingConfiguration()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void AddJsonConsole_OutsideConfig_TakesProperty()
{
var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
Expand Down Expand Up @@ -333,6 +340,7 @@ public void AddJsonConsole_OutsideConfig_TakesProperty()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void AddConsole_NullFormatterNameUsingSystemdFormat_AnyDeprecatedPropertiesOverwriteFormatterOptions()
{
var configs = new[] {
Expand Down Expand Up @@ -378,6 +386,7 @@ public void AddConsole_MaxQueueLengthSetToNegativeOrZero_Throws(int invalidMaxQu
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void AddConsole_MaxQueueLengthLargerThanZero_ConfiguredProperly()
{
var configs = new[] {
Expand All @@ -399,6 +408,7 @@ public void AddConsole_MaxQueueLengthLargerThanZero_ConfiguredProperly()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void AddConsole_NullFormatterName_UsingSystemdFormat_IgnoreFormatterOptionsAndUseDeprecatedInstead()
{
var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
Expand Down Expand Up @@ -431,6 +441,7 @@ public void AddConsole_NullFormatterName_UsingSystemdFormat_IgnoreFormatterOptio
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void AddConsole_NullFormatterName_UsingDefaultFormat_IgnoreFormatterOptionsAndUseDeprecatedInstead()
{
var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
Expand Down Expand Up @@ -470,6 +481,7 @@ public void AddConsole_NullFormatterName_UsingDefaultFormat_IgnoreFormatterOptio
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
[InlineData("missingFormatter")]
[InlineData("simple")]
[InlineData("Simple")]
Expand Down Expand Up @@ -513,6 +525,7 @@ public void AddConsole_FormatterNameIsSet_UsingDefaultFormat_IgnoreDeprecatedAnd
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
[InlineData("missingFormatter")]
[InlineData("systemd")]
[InlineData("Systemd")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class ConsoleLoggerProcessorTests
private const string _loggerName = "test";

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void LogAfterDisposeWritesLog()
{
// Arrange
Expand Down Expand Up @@ -63,6 +64,7 @@ public void LogsFlushedAfterDispose()
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
[InlineData(-1)]
[InlineData(0)]
public static void MaxQueueLength_SetInvalid_Throws(int invalidMaxQueueLength)
Expand Down
Loading

0 comments on commit 7eb6c0c

Please sign in to comment.