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

[browser][MT] enable active issues #102212

Merged
merged 5 commits into from
May 16, 2024
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
2 changes: 0 additions & 2 deletions eng/testing/tests.browser.targets
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@
<_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(WasmMainAssemblyFileName)' != ''">--run $(WasmMainAssemblyFileName)</_AppArgs>
<_AppArgs Condition="'$(IsFunctionalTest)' == 'true'">--run $(AssemblyName).dll</_AppArgs>

<WasmTestAppArgs Condition="'$(_XUnitBackgroundExec)' == 'true'">$(WasmTestAppArgs) -backgroundExec</WasmTestAppArgs>
pavelsavara marked this conversation as resolved.
Show resolved Hide resolved
<WasmXHarnessMonoArgs Condition="'$(_XUnitBackgroundExec)' == 'true'">$(WasmXHarnessMonoArgs) --setenv=IsWasmBackgroundExec=true</WasmXHarnessMonoArgs>
<_AppArgs Condition="'$(WasmTestAppArgs)' != ''">$(_AppArgs) $(WasmTestAppArgs)</_AppArgs>

<WasmXHarnessMonoArgs Condition="'$(XunitShowProgress)' == 'true'">$(WasmXHarnessMonoArgs) --setenv=XHARNESS_LOG_TEST_START=true</WasmXHarnessMonoArgs>
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/Common/tests/System/TimeProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ private static void CancelAfter(TimeProvider provider, CancellationTokenSource c
}
#endif // NETFRAMEWORK

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[MemberData(nameof(TimersProvidersListData))]
public static void CancellationTokenSourceWithTimer(TimeProvider provider)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ public static int SlowRuntimeTimeoutModifier
public static bool IsThreadingSupported => (!IsWasi && !IsBrowser) || IsWasmThreadingSupported;
public static bool IsWasmThreadingSupported => IsBrowser && IsEnvironmentVariableTrue("IsBrowserThreadingSupported");
public static bool IsNotWasmThreadingSupported => !IsWasmThreadingSupported;
public static bool IsWasmBackgroundExec => IsBrowser && IsEnvironmentVariableTrue("IsWasmBackgroundExec");
public static bool IsThreadingSupportedNotBrowserBackgroundExec => IsWasmThreadingSupported && !IsWasmBackgroundExec;
public static bool IsWasmBackgroundExecOrSingleThread => IsWasmBackgroundExec || IsNotWasmThreadingSupported;
public static bool IsThreadingSupportedOrBrowserBackgroundExec => IsWasmBackgroundExec || !IsBrowser;
public static bool IsBinaryFormatterSupported => IsNotMobile && !IsNativeAot;

public static bool IsStartingProcessesSupported => !IsiOS && !IstvOS;
Expand Down
13 changes: 1 addition & 12 deletions src/libraries/Common/tests/WasmTestRunner/WasmTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public static async Task<int> Main(string[] args)
var includedNamespaces = new List<string>();
var includedClasses = new List<string>();
var includedMethods = new List<string>();
var backgroundExec = false;
var untilFailed = false;

for (int i = 1; i < args.Length; i++)
Expand Down Expand Up @@ -57,9 +56,6 @@ public static async Task<int> Main(string[] args)
includedMethods.Add(args[i + 1]);
i++;
break;
case "-backgroundExec":
backgroundExec = true;
break;
case "-untilFailed":
untilFailed = true;
break;
Expand Down Expand Up @@ -94,14 +90,7 @@ public static async Task<int> Main(string[] args)
var res = 0;
do
{
if (backgroundExec)
{
res = await Task.Run(() => runner.Run());
}
else
{
res = await runner.Run();
}
res = await runner.Run();
}
while(res == 0 && untilFailed);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ public void CreateCallSite_EnumberableCachedAtLowestLevel(ServiceDescriptor[] de
Assert.Equal(typeof(IEnumerable<FakeService>), callSite.Cache.Key.ServiceIdentifier.ServiceType);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void CallSitesAreUniquePerServiceTypeAndSlot()
{
// Connected graph
Expand Down Expand Up @@ -828,7 +828,7 @@ public void CallSitesAreUniquePerServiceTypeAndSlot()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void CallSitesAreUniquePerServiceTypeAndSlotWithOpenGenericInGraph()
{
// Connected graph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public void GetService_DisposeOnSameThread_Throws()
});
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void GetAsyncService_DisposeAsyncOnSameThread_ThrowsAndDoesNotHangAndDisposeAsyncGetsCalled()
{
// Arrange
Expand All @@ -398,7 +398,7 @@ public void GetAsyncService_DisposeAsyncOnSameThread_ThrowsAndDoesNotHangAndDisp
Assert.True(asyncDisposableResource.DisposeAsyncCalled);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void GetService_DisposeOnSameThread_ThrowsAndDoesNotHangAndDisposeGetsCalled()
{
// Arrange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void BuildWebHostPattern_CanFindServiceProvider()
Assert.IsAssignableFrom<IServiceProvider>(factory(Array.Empty<string>()));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(BuildWebHostInvalidSignature.Program))]
public void BuildWebHostPattern__Invalid_CantFindWebHost()
{
Expand All @@ -46,7 +46,7 @@ public void BuildWebHostPattern__Invalid_CantFindWebHost()
Assert.Null(factory);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(BuildWebHostInvalidSignature.Program))]
public void BuildWebHostPattern__Invalid_CantFindServiceProvider()
{
Expand All @@ -55,7 +55,7 @@ public void BuildWebHostPattern__Invalid_CantFindServiceProvider()
Assert.NotNull(factory);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateWebHostBuilderPatternTestSite.Program))]
public void CreateWebHostBuilderPattern_CanFindWebHostBuilder()
{
Expand All @@ -65,7 +65,7 @@ public void CreateWebHostBuilderPattern_CanFindWebHostBuilder()
Assert.IsAssignableFrom<IWebHostBuilder>(factory(Array.Empty<string>()));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateWebHostBuilderPatternTestSite.Program))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(IWebHost))]
public void CreateWebHostBuilderPattern_CanFindServiceProvider()
Expand All @@ -76,7 +76,7 @@ public void CreateWebHostBuilderPattern_CanFindServiceProvider()
Assert.IsAssignableFrom<IServiceProvider>(factory(Array.Empty<string>()));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateWebHostBuilderInvalidSignature.Program))]
public void CreateWebHostBuilderPattern__Invalid_CantFindWebHostBuilder()
{
Expand All @@ -85,7 +85,7 @@ public void CreateWebHostBuilderPattern__Invalid_CantFindWebHostBuilder()
Assert.Null(factory);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateWebHostBuilderInvalidSignature.Program))]
public void CreateWebHostBuilderPattern__InvalidReturnType_CanFindServiceProvider()
{
Expand All @@ -95,7 +95,7 @@ public void CreateWebHostBuilderPattern__InvalidReturnType_CanFindServiceProvide
Assert.Null(factory(Array.Empty<string>()));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateHostBuilderPatternTestSite.Program))]
public void CreateHostBuilderPattern_CanFindHostBuilder()
{
Expand All @@ -105,7 +105,7 @@ public void CreateHostBuilderPattern_CanFindHostBuilder()
Assert.IsAssignableFrom<IHostBuilder>(factory(Array.Empty<string>()));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateHostBuilderPatternTestSite.Program))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(Host))]
public void CreateHostBuilderPattern_CanFindServiceProvider()
Expand All @@ -116,7 +116,7 @@ public void CreateHostBuilderPattern_CanFindServiceProvider()
Assert.IsAssignableFrom<IServiceProvider>(factory(Array.Empty<string>()));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateHostBuilderInvalidSignature.Program))]
public void CreateHostBuilderPattern__Invalid_CantFindHostBuilder()
{
Expand All @@ -125,7 +125,7 @@ public void CreateHostBuilderPattern__Invalid_CantFindHostBuilder()
Assert.Null(factory);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateHostBuilderInvalidSignature.Program))]
public void CreateHostBuilderPattern__Invalid_CantFindServiceProvider()
{
Expand All @@ -135,7 +135,7 @@ public void CreateHostBuilderPattern__Invalid_CantFindServiceProvider()
Assert.Throws<InvalidOperationException>(() => factory(Array.Empty<string>()));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))]
public void NoSpecialEntryPointPattern()
{
Expand All @@ -145,7 +145,7 @@ public void NoSpecialEntryPointPattern()
Assert.IsAssignableFrom<IServiceProvider>(factory(Array.Empty<string>()));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))]
public void NoSpecialEntryPointPatternHostBuilderConfigureHostBuilderCallbackIsCalled()
{
Expand All @@ -163,7 +163,7 @@ void ConfigureHostBuilder(object hostBuilder)
Assert.True(called);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))]
public void NoSpecialEntryPointPatternBuildsThenThrowsCallsEntryPointCompletedCallback()
{
Expand All @@ -183,7 +183,7 @@ void EntryPointCompleted(Exception? exception)
Assert.Null(entryPointException);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPatternBuildsThenThrows.Program))]
public void NoSpecialEntryPointPatternBuildsThenThrowsCallsEntryPointCompletedCallbackWithException()
{
Expand All @@ -203,7 +203,7 @@ void EntryPointCompleted(Exception? exception)
Assert.NotNull(entryPointException);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPatternThrows.Program))]
public void NoSpecialEntryPointPatternThrows()
{
Expand All @@ -213,7 +213,7 @@ public void NoSpecialEntryPointPatternThrows()
Assert.Throws<Exception>(() => factory(Array.Empty<string>()));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPatternExits.Program))]
public void NoSpecialEntryPointPatternExits()
{
Expand All @@ -223,7 +223,7 @@ public void NoSpecialEntryPointPatternExits()
Assert.Throws<InvalidOperationException>(() => factory(Array.Empty<string>()));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPatternHangs.Program))]
public void NoSpecialEntryPointPatternHangs()
{
Expand All @@ -233,7 +233,7 @@ public void NoSpecialEntryPointPatternHangs()
Assert.Throws<InvalidOperationException>(() => factory(Array.Empty<string>()));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPatternMainNoArgs.Program))]
public void NoSpecialEntryPointPatternMainNoArgs()
{
Expand All @@ -243,7 +243,7 @@ public void NoSpecialEntryPointPatternMainNoArgs()
Assert.IsAssignableFrom<IServiceProvider>(factory(Array.Empty<string>()));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, "Program", "TopLevelStatements")]
public void TopLevelStatements()
{
Expand All @@ -254,7 +254,7 @@ public void TopLevelStatements()
Assert.IsAssignableFrom<IServiceProvider>(factory(Array.Empty<string>()));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, "Program", "TopLevelStatementsTestsTimeout")]
public void TopLevelStatementsTestsTimeout()
{
Expand All @@ -265,7 +265,7 @@ public void TopLevelStatementsTestsTimeout()
Assert.Throws<InvalidOperationException>(() => factory(Array.Empty<string>()));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, "Program", "ApplicationNameSetFromArgument")]
public void ApplicationNameSetFromArgument()
{
Expand All @@ -277,7 +277,7 @@ public void ApplicationNameSetFromArgument()
Assert.Contains("ApplicationNameSetFromArgument", configuration["applicationName"]);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))]
public void NoSpecialEntryPointPatternCanRunInParallel()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ public async Task AddHttpClient_MessageHandler_Scope_TransientDependency()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec), nameof(PlatformDetection.IsReflectionEmitSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))]
public void AddHttpClient_GetAwaiterAndResult_InSingleThreadedSynchronizationContext_ShouldNotHangs()
{
// Arrange
Expand Down
1 change: 0 additions & 1 deletion src/libraries/System.IO.Pipelines/tests/PipeWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ public async Task WritesUsingGetMemoryWorks()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91547", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public async Task CompleteWithLargeWriteThrows()
{
var completeDelay = TimeSpan.FromMilliseconds(10);
Expand Down
Loading
Loading