Skip to content

Commit

Permalink
[browser][MT] enable more tests (dotnet#97391)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelsavara authored Jan 25, 2024
1 parent f532ff6 commit b4913ba
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ 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
shouldContinueOnError: true
scenarios:
- WasmTestOnBrowser
#- WasmTestOnNodeJS - this is not supported yet, https://github.com/dotnet/runtime/issues/85592
Expand Down
1 change: 0 additions & 1 deletion src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public static IEnumerable<object[]> AllMergeOptions_Multiple()

[ConditionalTheory]
[MemberData(nameof(PartitioningData), new[] { 0, 1, 2, 16, 1024 })]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public static void Partitioning_Default(Labeled<ParallelQuery<int>> labeled, int count, int partitions)
{
if (partitions > 1 && !PlatformDetection.IsThreadingSupported)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public static void ReadAfterInitializationWithTextReaderOnAsyncReaderDoesNotThro
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public static void ReadAsyncAfterInitializationWithUriThrows()
{
using (XmlReader reader = XmlReader.Create("http://test.test/test.html", new XmlReaderSettings() { Async = true }))
Expand All @@ -79,7 +78,6 @@ public static void ReadAsyncAfterInitializationWithUriThrows()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public static void ReadAfterInitializationWithUriOnAsyncReaderTrows()
{
using (XmlReader reader = XmlReader.Create("http://test.test/test.html", new XmlReaderSettings() { Async = true }))
Expand All @@ -89,7 +87,6 @@ public static void ReadAfterInitializationWithUriOnAsyncReaderTrows()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public static void InitializationWithUriOnNonAsyncReaderThrows()
{
Assert.Throws<System.Net.Http.HttpRequestException>(() => XmlReader.Create("http://test.test/test.html", new XmlReaderSettings() { Async = false }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ public TCValidateAfterAddInvalidSchema(ITestOutputHelper output) : base(output)
[InlineData("SCHEMA", "schB1_a.xsd", 1, 3, 3)]
[InlineData("SCHEMA", "schM2_a.xsd", 1, 3, 3)]
[InlineData("SCHEMA", "schH2_a.xsd", 1, 3, 3)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/75132", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public void AddValid_Import_Include_Redefine(string testDir, string testFile, int expCount, int expCountGT, int expCountGE)
{
string xsd = Path.Combine(path, testDir, testFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ public static async Task Task_WhenAny_TwoTasks_WakesOnFirstCompletion()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public static void CancellationTokenRegitration()
{
ManualResetEvent mre = new ManualResetEvent(false);
Expand All @@ -297,7 +296,6 @@ public static void CancellationTokenRegitration()
/// verify that the taskawaiter.UnsafeOnCompleted is invoked
/// </summary>
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public static void TaskAwaiter()
{
ManualResetEvent mre = new ManualResetEvent(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ static async IAsyncEnumerable<int> CreateSourceEnumerable()
}

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

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

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public static void AsyncEnumerableWithCancellation()
{
var source = new InstrumentedAsyncEnumerable<string>(CreateSourceEnumerable());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,6 @@ public static void LongContinuationChain_Unwrap_DoesNotStackOverflow()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public static void LongContinuationChain_Await_DoesNotStackOverflow()
{
const int DiveDepth = 12_000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,7 @@ public static void RunParallelLoopCancellationTests()
/// Test to ensure that the task ID can be accessed from inside the task
/// </summary>
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91583", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public static void TaskIDFromExternalContextTest()
{
int? withinTaskId = int.MinValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static void oneMoveNext(int length, bool isOrderable)
/// </summary>
/// <param name="length"></param>
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/97396", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public static void IterationsWithDependency()
{
static void iterationsWithDependency(int length, int dependencyIndex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace System.Threading.Tasks.Tests
public static class RangePartitionerTests
{
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/97440", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public static void RunPartitionerStaticTest_SingleChunking()
{
CountdownEvent cde = new CountdownEvent(2);
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Threading/tests/MonitorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ public static void WaitTest()
Monitor.Pulse(obj);
}
Monitor.Exit(obj);
t.Join(500);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,8 @@ public static void ReleaseReadersWhenWaitingWriterTimesOut()
// Typical order of execution: 7

writeWaiterThread.Join();
readerThreads[0].Join();
readerThreads[1].Join();
}
}

Expand Down
4 changes: 0 additions & 4 deletions src/libraries/System.Threading/tests/SemaphoreSlimTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public static void RunSemaphoreSlimTest1_Wait_NegativeCases()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public static void RunSemaphoreSlimTest1_WaitAsync()
{
// Infinite timeout
Expand All @@ -91,7 +90,6 @@ public static void RunSemaphoreSlimTest1_WaitAsync()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public static void RunSemaphoreSlimTest1_WaitAsync_NegativeCases()
{
// Invalid timeout
Expand Down Expand Up @@ -464,7 +462,6 @@ private static void RunSemaphoreSlimTest7_AvailableWaitHandle_Helper(int initial
/// <param name="finalCount">The final semaphore count</param>
/// <returns>True if the test succeeded, false otherwise</returns>
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
[InlineData(5, 1000, 50, 50, 50, 0, 5, 1000)]
[InlineData(0, 1000, 50, 25, 25, 25, 0, 500)]
[InlineData(0, 1000, 50, 0, 0, 50, 0, 100)]
Expand Down Expand Up @@ -531,7 +528,6 @@ public static void RunSemaphoreSlimTest8_ConcWaitAndRelease(int initial, int max
/// <param name="finalCount">The final semaphore count</param>
/// <returns>True if the test succeeded, false otherwise</returns>
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
[InlineData(5, 1000, 50, 50, 50, 0, 5, 500)]
[InlineData(0, 1000, 50, 25, 25, 25, 0, 500)]
[InlineData(0, 1000, 50, 0, 0, 50, 0, 100)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,7 @@ public void VerifyBYOTOpenConnSimulationTest()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/97513", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))]
public async Task VerifyBYOTSyncTSNestedAsync()
{
string txId1;
Expand Down
19 changes: 9 additions & 10 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
<HighAOTResourceRequiringProject Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.Tests\System.Text.Json.Tests.csproj" />
</ItemGroup>

<!-- Samples which are too complex for CI -->
<ItemGroup Condition="'$(TargetOS)' == 'browser'">
<!-- Samples which are too complex for CI -->
<ProjectExclusions Include="$(MonoProjectRoot)sample\wasm\console-node-ts\Wasm.Console.Node.TS.Sample.csproj" />
<ProjectExclusions Include="$(MonoProjectRoot)sample\wasm\browser-webpack\Wasm.Browser.WebPack.Sample.csproj" />
<ProjectExclusions Include="$(MonoProjectRoot)sample\wasm\node-webpack\Wasm.Node.WebPack.Sample.csproj" />
Expand All @@ -50,6 +50,10 @@

<!-- These tests are completely disabled on wasm -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.RegularExpressions/tests/System.Text.RegularExpressions.Generators.Tests/System.Text.RegularExpressions.Generators.Tests.csproj" />

<!-- Issue: https://github.com/dotnet/runtime/issues/97295 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Numerics.Tensors\tests\System.Numerics.Tensors.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Numerics.Tensors\tests\Net8Tests\System.Numerics.Tensors.Net8.Tests.csproj" />
</ItemGroup>

<!-- Samples that require a multi-threaded runtime -->
Expand Down Expand Up @@ -395,10 +399,8 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetOS)' == 'browser' and '$(MonoWasmBuildVariant)' == 'multithread' and '$(RunDisabledWasmTests)' != 'true'">
<!-- Issue: https://github.com/dotnet/runtime/issues/74411 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Http\tests\FunctionalTests\System.Net.Http.Functional.Tests.csproj" />
<!-- Issue: https://github.com/dotnet/runtime/issues/74413 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.WebSockets.Client\tests\System.Net.WebSockets.Client.Tests.csproj" />
<!-- Until: https://github.com/dotnet/runtime/pull/97441 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.InteropServices.JavaScript\tests\System.Runtime.InteropServices.JavaScript.UnitTests\System.Runtime.InteropServices.JavaScript.Tests.csproj" />
<!-- Issue: https://github.com/dotnet/runtime/issues/95795 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Globalization.Tests\Hybrid\System.Globalization.Hybrid.WASM.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Globalization.Calendars.Tests\Hybrid\System.Globalization.Calendars.Hybrid.WASM.Tests.csproj" />
Expand Down Expand Up @@ -605,14 +607,11 @@
<!-- Don't want the default smoke tests - just verify that threading works -->
<SmokeTestProject Remove="@(SmokeTestProject)" />
<SmokeTestProject Include="$(MonoProjectRoot)sample\wasm\browser-threads\Wasm.Browser.Threads.Sample.csproj" />
<!-- this sample is messy sandbox right now
<SmokeTestProject Include="$(MonoProjectRoot)sample\wasm\browser-threads-minimal\Wasm.Browser.Threads.Minimal.Sample.csproj" />
-->
<!-- ActiveIssue https://github.com/dotnet/runtime/issues/96628
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Net.WebSockets.Client\tests\System.Net.WebSockets.Client.Tests.csproj" />
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Runtime.InteropServices.JavaScript\tests\System.Runtime.InteropServices.JavaScript.UnitTests\System.Runtime.InteropServices.JavaScript.Tests.csproj" />
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Net.Http\tests\FunctionalTests\System.Net.Http.Functional.Tests.csproj" />
-->
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Net.WebSockets.Client\tests\System.Net.WebSockets.Client.Tests.csproj" />
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Net.Http\tests\FunctionalTests\System.Net.Http.Functional.Tests.csproj" />
</ItemGroup>

<!--
Expand Down

0 comments on commit b4913ba

Please sign in to comment.