From dc13b069237f5e839dbffb6943bcd86ff205a995 Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Thu, 25 Jan 2024 16:41:33 +0100 Subject: [PATCH] rebase, smaller set of changes --- .../runtime-extra-platforms-wasm.yml | 2 -- .../tests/ExchangeTests.cs | 1 - .../Tests/AsyncReaderLateInitTests.cs | 3 --- .../XmlSchemaValidatorApi/ValidateMisc.cs | 1 - .../MethodCoverage.cs | 2 -- ...syncEnumerableToBlockingEnumerableTests.cs | 3 --- .../Task/TaskContinueWithTests.cs | 1 - .../tests/ParallelForTests.cs | 1 + .../tests/RangePartitioner1Chunk.cs | 2 +- .../tests/RangePartitionerTests.cs | 2 +- .../System.Threading/tests/MonitorTests.cs | 1 + .../tests/ReaderWriterLockSlimTests.cs | 2 ++ .../tests/SemaphoreSlimTests.cs | 4 ---- .../tests/AsyncTransactionScopeTests.cs | 1 + src/libraries/tests.proj | 19 +++++++++---------- 15 files changed, 16 insertions(+), 29 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index 12981837609c3..6e9adb3aac7c5 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -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 diff --git a/src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs b/src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs index 5c36f46c5d207..6dcaffbf60a5a 100644 --- a/src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs @@ -90,7 +90,6 @@ public static IEnumerable 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> labeled, int count, int partitions) { if (partitions > 1 && !PlatformDetection.IsThreadingSupported) diff --git a/src/libraries/System.Private.Xml/tests/XmlReader/Tests/AsyncReaderLateInitTests.cs b/src/libraries/System.Private.Xml/tests/XmlReader/Tests/AsyncReaderLateInitTests.cs index 05fd83798861d..85f2fd9fdf7f1 100644 --- a/src/libraries/System.Private.Xml/tests/XmlReader/Tests/AsyncReaderLateInitTests.cs +++ b/src/libraries/System.Private.Xml/tests/XmlReader/Tests/AsyncReaderLateInitTests.cs @@ -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 })) @@ -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 })) @@ -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(() => XmlReader.Create("http://test.test/test.html", new XmlReaderSettings() { Async = false })); diff --git a/src/libraries/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateMisc.cs b/src/libraries/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateMisc.cs index c594669aaaec6..1e9fb3a25599a 100644 --- a/src/libraries/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateMisc.cs +++ b/src/libraries/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateMisc.cs @@ -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); diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/MethodCoverage.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/MethodCoverage.cs index 88ec6cdca2948..923875f6e43ce 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/MethodCoverage.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/MethodCoverage.cs @@ -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); @@ -297,7 +296,6 @@ public static void CancellationTokenRegitration() /// verify that the taskawaiter.UnsafeOnCompleted is invoked /// [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); diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/AsyncEnumerableToBlockingEnumerableTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/AsyncEnumerableToBlockingEnumerableTests.cs index 7f7aca4a8611f..0692aedb514f9 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/AsyncEnumerableToBlockingEnumerableTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/AsyncEnumerableToBlockingEnumerableTests.cs @@ -70,7 +70,6 @@ static async IAsyncEnumerable 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(CreateSourceEnumerable()); @@ -105,7 +104,6 @@ static async IAsyncEnumerable 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(CreateSourceEnumerable()); @@ -134,7 +132,6 @@ static async IAsyncEnumerable 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(CreateSourceEnumerable()); diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWithTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWithTests.cs index af2b79e07b2c3..b426a576d982b 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWithTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWithTests.cs @@ -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; diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs index 0c740c8b0ee70..7ae7693fb2031 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs @@ -1213,6 +1213,7 @@ public static void RunParallelLoopCancellationTests() /// Test to ensure that the task ID can be accessed from inside the task /// [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; diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitioner1Chunk.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitioner1Chunk.cs index 02695b7524240..c01449dc5d674 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitioner1Chunk.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitioner1Chunk.cs @@ -101,7 +101,7 @@ static void oneMoveNext(int length, bool isOrderable) /// /// [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) diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitionerTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitionerTests.cs index 3302c9b3b7383..e9452695618ea 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitionerTests.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitionerTests.cs @@ -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); diff --git a/src/libraries/System.Threading/tests/MonitorTests.cs b/src/libraries/System.Threading/tests/MonitorTests.cs index ca8ebe9544be1..13cb675cef34a 100644 --- a/src/libraries/System.Threading/tests/MonitorTests.cs +++ b/src/libraries/System.Threading/tests/MonitorTests.cs @@ -447,6 +447,7 @@ public static void WaitTest() Monitor.Pulse(obj); } Monitor.Exit(obj); + t.Join(500); } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] diff --git a/src/libraries/System.Threading/tests/ReaderWriterLockSlimTests.cs b/src/libraries/System.Threading/tests/ReaderWriterLockSlimTests.cs index d4569737e3507..bf4fdd72cc6fd 100644 --- a/src/libraries/System.Threading/tests/ReaderWriterLockSlimTests.cs +++ b/src/libraries/System.Threading/tests/ReaderWriterLockSlimTests.cs @@ -446,6 +446,8 @@ public static void ReleaseReadersWhenWaitingWriterTimesOut() // Typical order of execution: 7 writeWaiterThread.Join(); + readerThreads[0].Join(); + readerThreads[1].Join(); } } diff --git a/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs b/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs index 4c2c5cc53a524..7aabd01c39f1e 100644 --- a/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs +++ b/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs @@ -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 @@ -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 @@ -464,7 +462,6 @@ private static void RunSemaphoreSlimTest7_AvailableWaitHandle_Helper(int initial /// The final semaphore count /// True if the test succeeded, false otherwise [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)] @@ -531,7 +528,6 @@ public static void RunSemaphoreSlimTest8_ConcWaitAndRelease(int initial, int max /// The final semaphore count /// True if the test succeeded, false otherwise [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)] diff --git a/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs b/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs index ff5c050292fcf..ffe5ea9adb7e3 100644 --- a/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs +++ b/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs @@ -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; diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 2d3d56e60caef..ec3fc45ea7502 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -40,8 +40,8 @@ - + @@ -50,6 +50,10 @@ + + + + @@ -395,10 +399,8 @@ - - - - + + @@ -605,14 +607,11 @@ - + +