Skip to content

Commit 28dcc44

Browse files
authored
[browser][MT] GC, more testing and cleanup (#94466)
1 parent b2538c4 commit 28dcc44

29 files changed

Lines changed: 61 additions & 75 deletions

File tree

src/libraries/Common/tests/WasmTestRunner/WasmTestRunner.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public static async Task<int> Main(string[] args)
6464
IncludedMethods = includedMethods
6565
};
6666

67+
await Task.Yield();
6768
return await runner.Run();
6869
}
6970
}

src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ public void ApplicationNameSetFromArgument()
279279

280280
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
281281
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))]
282-
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
283282
public void NoSpecialEntryPointPatternCanRunInParallel()
284283
{
285284
var factory = HostFactoryResolver.ResolveServiceProviderFactory(typeof(NoSpecialEntryPointPattern.Program).Assembly, s_WaitTimeout);

src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/JsonConsoleFormatterTests.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ namespace Microsoft.Extensions.Logging.Console.Test
1818
public class JsonConsoleFormatterTests : ConsoleFormatterTests
1919
{
2020
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
21-
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
2221
public void NoLogScope_DoesNotWriteAnyScopeContentToOutput_Json()
2322
{
2423
// Arrange
@@ -80,7 +79,6 @@ public void Log_TimestampFormatSet_ContainsTimestamp()
8079
}
8180

8281
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
83-
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
8482
public void Log_NullMessage_LogsWhenMessageIsNotProvided()
8583
{
8684
// Arrange
@@ -125,7 +123,6 @@ public void Log_NullMessage_LogsWhenMessageIsNotProvided()
125123
}
126124

127125
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
128-
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
129126
public void Log_ExceptionWithMessage_ExtractsInfo()
130127
{
131128
// Arrange
@@ -180,7 +177,6 @@ public void Log_ExceptionWithMessage_ExtractsInfo()
180177
}
181178

182179
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
183-
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
184180
public void Log_IncludeScopes_ContainsDuplicateNamedPropertiesInScope_AcceptableJson()
185181
{
186182
// Arrange
@@ -214,7 +210,6 @@ public void Log_IncludeScopes_ContainsDuplicateNamedPropertiesInScope_Acceptable
214210
}
215211

216212
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
217-
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
218213
public void Log_StateAndScopeAreCollections_IncludesMessageAndCollectionValues()
219214
{
220215
// Arrange
@@ -250,7 +245,6 @@ public void Log_StateAndScopeAreCollections_IncludesMessageAndCollectionValues()
250245
}
251246

252247
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
253-
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
254248
[MemberData(nameof(SpecialCaseValues))]
255249
public void Log_StateAndScopeContainsSpecialCaseValue_SerializesValueAsExpected(object value, string expectedJsonValue)
256250
{
@@ -281,7 +275,6 @@ public void Log_StateAndScopeContainsSpecialCaseValue_SerializesValueAsExpected(
281275
}
282276

283277
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
284-
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
285278
[MemberData(nameof(FloatingPointValues))]
286279
public void Log_StateAndScopeContainsFloatingPointType_SerializesValue(object value)
287280
{
@@ -321,7 +314,6 @@ static void AssertMessageValue(string message, string propertyName)
321314
}
322315

323316
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
324-
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
325317
public void Log_StateAndScopeContainsNullValue_SerializesNull()
326318
{
327319
// Arrange
@@ -351,7 +343,6 @@ public void Log_StateAndScopeContainsNullValue_SerializesNull()
351343
}
352344

353345
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
354-
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
355346
public void Log_ScopeIsIEnumerable_SerializesKeyValuePair()
356347
{
357348
// Arrange

src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/Microsoft.Extensions.Logging.Console.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
<TestRuntime>true</TestRuntime>
66
<EnableDefaultItems>true</EnableDefaultItems>
77
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
8+
<_WasmPThreadPoolSize Condition="'$(MonoWasmBuildVariant)' == 'multithread'">100</_WasmPThreadPoolSize>
89
</PropertyGroup>
910

1011
<ItemGroup>
1112
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Logging.Console\src\Microsoft.Extensions.Logging.Console.csproj" SkipUseReferenceAssembly="true" />
1213
</ItemGroup>
1314

14-
</Project>
15+
</Project>

src/libraries/System.Collections.Concurrent/tests/ProducerConsumerCollectionTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ public void ICollectionCopyTo_InvalidArgs_Throws()
483483
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
484484
[InlineData(100, 1, 10)]
485485
[InlineData(4, 100000, 10)]
486+
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
486487
public void BlockingCollection_WrappingCollection_ExpectedElementsTransferred(int numThreadsPerConsumerProducer, int numItemsPerThread, int producerSpin)
487488
{
488489
var bc = new BlockingCollection<int>(CreateProducerConsumerCollection());

src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public static IEnumerable<object[]> AllMergeOptions_Multiple()
9090

9191
[ConditionalTheory]
9292
[MemberData(nameof(PartitioningData), new[] { 0, 1, 2, 16, 1024 })]
93+
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
9394
public static void Partitioning_Default(Labeled<ParallelQuery<int>> labeled, int count, int partitions)
9495
{
9596
if (partitions > 1 && !PlatformDetection.IsThreadingSupported)

src/libraries/System.Threading.Tasks/tests/CancellationTokenTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,7 @@ static void FinalizeHelper(DisposeTracker disposeTracker)
874874

875875
// Several tests for deriving custom user types from CancellationTokenSource
876876
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
877+
[ActiveIssue("https://github.com/dotnet/runtime/issues/94486", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
877878
public static void DerivedCancellationTokenSource()
878879
{
879880
// Verify that a derived CTS is functional

src/libraries/System.Threading.Tasks/tests/MethodCoverage.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ public static async Task Task_WhenAny_TwoTasks_WakesOnFirstCompletion()
279279
}
280280

281281
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
282+
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
282283
public static void CancellationTokenRegitration()
283284
{
284285
ManualResetEvent mre = new ManualResetEvent(false);
@@ -296,6 +297,7 @@ public static void CancellationTokenRegitration()
296297
/// verify that the taskawaiter.UnsafeOnCompleted is invoked
297298
/// </summary>
298299
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
300+
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
299301
public static void TaskAwaiter()
300302
{
301303
ManualResetEvent mre = new ManualResetEvent(false);

src/libraries/System.Threading.Tasks/tests/System.Threading.Tasks.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<TestRuntime>true</TestRuntime>
44
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
55
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
6+
<_WasmPThreadPoolSize Condition="'$(MonoWasmBuildVariant)' == 'multithread'">64</_WasmPThreadPoolSize>
67
</PropertyGroup>
78
<ItemGroup>
89
<Compile Include="Helpers.cs" />

src/libraries/System.Threading.Tasks/tests/Task/AsyncEnumerableToBlockingEnumerableTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ static async IAsyncEnumerable<int> CreateSourceEnumerable()
7070
}
7171

7272
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
73+
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
7374
public static void AsyncEnumerableWithDelays()
7475
{
7576
var source = new InstrumentedAsyncEnumerable<int>(CreateSourceEnumerable());
@@ -104,6 +105,7 @@ static async IAsyncEnumerable<int> CreateSourceEnumerable()
104105
}
105106

106107
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
108+
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
107109
public static void AsyncEnumerableWithException()
108110
{
109111
var source = new InstrumentedAsyncEnumerable<int>(CreateSourceEnumerable());
@@ -132,6 +134,7 @@ static async IAsyncEnumerable<int> CreateSourceEnumerable()
132134
}
133135

134136
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
137+
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
135138
public static void AsyncEnumerableWithCancellation()
136139
{
137140
var source = new InstrumentedAsyncEnumerable<string>(CreateSourceEnumerable());

0 commit comments

Comments
 (0)