From 43abee446e2e47919bac3a17659509583808dae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Wed, 22 Apr 2026 15:28:14 +0000 Subject: [PATCH 1/6] Enable StackTraceLineNumberSupport for browser in StackTrace tests Enable StackTraceLineNumberSupport in the System.Diagnostics.StackTrace.Tests project when targeting browser. This ensures line number information is available in stack traces on browser-wasm, which should allow stack trace tests (like ToString_Async) to pass on CoreCLR+browser without needing to be skipped. Addresses feedback from https://github.com/dotnet/runtime/pull/127147#discussion_r3124035840 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/System.Diagnostics.StackTrace.Tests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.Diagnostics.StackTrace/tests/System.Diagnostics.StackTrace.Tests.csproj b/src/libraries/System.Diagnostics.StackTrace/tests/System.Diagnostics.StackTrace.Tests.csproj index 0bfb7e8074f4fd..a33f143faa76a6 100644 --- a/src/libraries/System.Diagnostics.StackTrace/tests/System.Diagnostics.StackTrace.Tests.csproj +++ b/src/libraries/System.Diagnostics.StackTrace/tests/System.Diagnostics.StackTrace.Tests.csproj @@ -8,6 +8,7 @@ true + true false false From 77706c82618cee408a2cc062b907d5e2cc15501d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Wed, 22 Apr 2026 15:37:05 +0000 Subject: [PATCH 2/6] Add unset guard to StackTraceLineNumberSupport condition Match the DebuggerSupport pattern so repo-wide configuration can still override the value when needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/System.Diagnostics.StackTrace.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Diagnostics.StackTrace/tests/System.Diagnostics.StackTrace.Tests.csproj b/src/libraries/System.Diagnostics.StackTrace/tests/System.Diagnostics.StackTrace.Tests.csproj index a33f143faa76a6..8611372f552f6a 100644 --- a/src/libraries/System.Diagnostics.StackTrace/tests/System.Diagnostics.StackTrace.Tests.csproj +++ b/src/libraries/System.Diagnostics.StackTrace/tests/System.Diagnostics.StackTrace.Tests.csproj @@ -8,7 +8,7 @@ true - true + true false false From 073f2b82f9d81f002bf9e3a6ac613af9542c05d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Fri, 24 Apr 2026 09:36:19 +0000 Subject: [PATCH 3/6] Re-enable browser/CoreCLR test suites with targeted test skips Remove 6 test project exclusions from tests.proj that were disabled due to build errors (WasmTriggerPublishApp for CoreCLR not implemented), which are now resolved. For tests that still fail due to platform limitations on browser-wasm: - CollectibleAssemblyLoadContextTest: Add [ActiveIssue] for IsBrowser on 11 Unload tests (collectible ALC unloading broken on browser-wasm) - FileStream Dispose tests: Add IsNotBrowser to 8 finalizer-based tests (no finalizer thread on single-threaded WASM) The 3 Reflection test suites (MetadataLoadContext, Metadata, Reflection) pass without changes. The StackTrace ToString_Async test is fixed by the StackTraceLineNumberSupport enablement in this branch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/CollectibleAssemblyLoadContextTest.cs | 11 +++++++++++ .../FileStream/Dispose.cs | 16 ++++++++-------- src/libraries/tests.proj | 9 +-------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/libraries/System.Runtime.Loader/tests/CollectibleAssemblyLoadContextTest.cs b/src/libraries/System.Runtime.Loader/tests/CollectibleAssemblyLoadContextTest.cs index 9a717078bc1741..319ad51f0eeb00 100644 --- a/src/libraries/System.Runtime.Loader/tests/CollectibleAssemblyLoadContextTest.cs +++ b/src/libraries/System.Runtime.Loader/tests/CollectibleAssemblyLoadContextTest.cs @@ -33,6 +33,7 @@ static void CreateAndLoadContext(CollectibleChecker checker, bool unloadTwice = [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_CollectibleWithNoAssemblyLoaded() { // Use a collectible ALC + Unload @@ -45,6 +46,7 @@ public static void Unload_CollectibleWithNoAssemblyLoaded() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void DoubleUnload_CollectibleWithNoAssemblyLoaded() { // Use a collectible ALC + Unload @@ -127,6 +129,7 @@ class CollectibleWithOneAssemblyLoadedTest : TestBase [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_CollectibleWithOneAssemblyLoaded() { // Use a collectible ALC + Load an assembly by path + Unload @@ -154,6 +157,7 @@ public void Execute() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_CollectibleWithOneAssemblyLoadedWithStatic() { // Use a collectible ALC + Load an assembly by path + New Instance + Static reference + Unload @@ -186,6 +190,7 @@ public void CheckInstanceUnloaded() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_CollectibleWithOneAssemblyLoadedWithWeakReferenceToType() { // Use a collectible ALC + Load an assembly by path + WeakReference on the Type + Unload @@ -220,6 +225,7 @@ public void CheckInstanceUnloaded() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_CollectibleWithOneAssemblyLoadedWithWeakReferenceToInstance() { // Use a collectible ALC + Load an assembly by path + WeakReference on an instance of a Type + Unload @@ -272,6 +278,7 @@ public void CheckTypeUnloaded() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_CollectibleWithOneAssemblyLoadedWithStrongReferenceToType() { // Use a collectible ALC + Load an assembly by path + Strong reference on the Type + Unload @@ -333,6 +340,7 @@ public void CheckInstanceUnloaded() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_CollectibleWithOneAssemblyLoadedWithStrongReferenceToInstance() { // Use a collectible ALC + Load an assembly by path + Strong reference on an instance of a Type + Unload @@ -367,6 +375,7 @@ public void Execute() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_CollectibleWithTwoAssemblies() { // Use a collectible ALC + Load two assemblies (path + stream) + Unload @@ -428,6 +437,7 @@ public void CheckContextUnloaded2() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_TwoCollectibleWithOneAssemblyAndOneInstanceReferencingAnother() { // We create 2 collectible ALC, load one assembly in each, create one instance in each, reference one instance from ALC1 to ALC2 @@ -497,6 +507,7 @@ public void CheckContextUnloaded2() // Test may fail when running on a different runtime [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_TwoCollectibleWithOneAssemblyAndOneInstanceReferencingAnotherThroughGenericStatic() { // We create 2 collectible ALC, load one assembly in each, create one instance in the ALC2, diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/Dispose.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/Dispose.cs index 803ebbb5edd6e5..e4fe6560cbacd3 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/Dispose.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/Dispose.cs @@ -169,7 +169,7 @@ public void Dispose_CallsVirtualDispose_TrueArg() Assert.False(disposeInvoked, "Expected finalizer to have been suppressed"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported), nameof(PlatformDetection.IsNotBrowser))] public void Finalizer_CallsVirtualDispose_FalseArg() { bool disposeInvoked = false; @@ -345,24 +345,24 @@ public void VerifyAfterDispose() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported), nameof(PlatformDetection.IsNotBrowser))] public void FinalizeFlushesWriteBuffer() => VerifyFlushedBufferOnFinalization( filePath => new FileStream(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite | FileShare.Delete, bufferSize: 4096, useAsync: false)); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported), nameof(PlatformDetection.IsNotBrowser))] public void FinalizeFlushesWriteBufferForDerivedFileStreamWithFinalizerCreatedFromPath() => VerifyFlushedBufferOnFinalization( filePath => new DerivedFileStreamWithFinalizer(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite | FileShare.Delete, bufferSize: 4096, FileOptions.None)); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported), nameof(PlatformDetection.IsNotBrowser))] public void FinalizeFlushesWriteBufferForDerivedFileStreamWithFinalizerCreatedFromSafeFileHandle() => VerifyFlushedBufferOnFinalization( filePath => new DerivedFileStreamWithFinalizer( File.OpenHandle(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite | FileShare.Delete, FileOptions.None), FileAccess.Write, bufferSize: 4096, isAsync: false)); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported), nameof(PlatformDetection.IsNotBrowser))] public void FinalizeFlushesWriteBufferForDerivedFileStreamWithFinalizerCreatedFromIntPtr() => VerifyFlushedBufferOnFinalization( filePath => new DerivedFileStreamWithFinalizer( @@ -370,19 +370,19 @@ public void FinalizeFlushesWriteBufferForDerivedFileStreamWithFinalizerCreatedFr FileAccess.Write, ownsHandle: true)); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported), nameof(PlatformDetection.IsNotBrowser))] public void FinalizeFlushesWriteBufferForDerivedFileStreamWithoutFinalizerCreatedFromPath() => VerifyFlushedBufferOnFinalization( filePath => new DerivedFileStreamWithoutFinalizer(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite | FileShare.Delete, bufferSize: 4096, FileOptions.None)); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported), nameof(PlatformDetection.IsNotBrowser))] public void FinalizeFlushesWriteBufferForDerivedFileStreamWithoutFinalizerCreatedFromSafeFileHandle() => VerifyFlushedBufferOnFinalization( filePath => new DerivedFileStreamWithoutFinalizer( File.OpenHandle(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite | FileShare.Delete, FileOptions.None), FileAccess.Write, bufferSize: 4096, isAsync: false)); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported), nameof(PlatformDetection.IsNotBrowser))] public void FinalizeFlushesWriteBufferForDerivedFileStreamWithoutFinalizerCreatedFromIntPtr() => VerifyFlushedBufferOnFinalization( filePath => new DerivedFileStreamWithoutFinalizer( diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 98a7a55e08b9c7..d6c4aed495b680 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -183,15 +183,8 @@ - + - - - - - - - From b748a4744e9b723c0a77099bc9ec90dd525ab2ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Fri, 24 Apr 2026 09:41:00 +0000 Subject: [PATCH 4/6] Revert "Re-enable browser/CoreCLR test suites with targeted test skips" This reverts commit 073f2b82f9d81f002bf9e3a6ac613af9542c05d0. --- .../tests/CollectibleAssemblyLoadContextTest.cs | 11 ----------- .../FileStream/Dispose.cs | 16 ++++++++-------- src/libraries/tests.proj | 9 ++++++++- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/libraries/System.Runtime.Loader/tests/CollectibleAssemblyLoadContextTest.cs b/src/libraries/System.Runtime.Loader/tests/CollectibleAssemblyLoadContextTest.cs index 319ad51f0eeb00..9a717078bc1741 100644 --- a/src/libraries/System.Runtime.Loader/tests/CollectibleAssemblyLoadContextTest.cs +++ b/src/libraries/System.Runtime.Loader/tests/CollectibleAssemblyLoadContextTest.cs @@ -33,7 +33,6 @@ static void CreateAndLoadContext(CollectibleChecker checker, bool unloadTwice = [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_CollectibleWithNoAssemblyLoaded() { // Use a collectible ALC + Unload @@ -46,7 +45,6 @@ public static void Unload_CollectibleWithNoAssemblyLoaded() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void DoubleUnload_CollectibleWithNoAssemblyLoaded() { // Use a collectible ALC + Unload @@ -129,7 +127,6 @@ class CollectibleWithOneAssemblyLoadedTest : TestBase [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_CollectibleWithOneAssemblyLoaded() { // Use a collectible ALC + Load an assembly by path + Unload @@ -157,7 +154,6 @@ public void Execute() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_CollectibleWithOneAssemblyLoadedWithStatic() { // Use a collectible ALC + Load an assembly by path + New Instance + Static reference + Unload @@ -190,7 +186,6 @@ public void CheckInstanceUnloaded() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_CollectibleWithOneAssemblyLoadedWithWeakReferenceToType() { // Use a collectible ALC + Load an assembly by path + WeakReference on the Type + Unload @@ -225,7 +220,6 @@ public void CheckInstanceUnloaded() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_CollectibleWithOneAssemblyLoadedWithWeakReferenceToInstance() { // Use a collectible ALC + Load an assembly by path + WeakReference on an instance of a Type + Unload @@ -278,7 +272,6 @@ public void CheckTypeUnloaded() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_CollectibleWithOneAssemblyLoadedWithStrongReferenceToType() { // Use a collectible ALC + Load an assembly by path + Strong reference on the Type + Unload @@ -340,7 +333,6 @@ public void CheckInstanceUnloaded() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_CollectibleWithOneAssemblyLoadedWithStrongReferenceToInstance() { // Use a collectible ALC + Load an assembly by path + Strong reference on an instance of a Type + Unload @@ -375,7 +367,6 @@ public void Execute() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_CollectibleWithTwoAssemblies() { // Use a collectible ALC + Load two assemblies (path + stream) + Unload @@ -437,7 +428,6 @@ public void CheckContextUnloaded2() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_TwoCollectibleWithOneAssemblyAndOneInstanceReferencingAnother() { // We create 2 collectible ALC, load one assembly in each, create one instance in each, reference one instance from ALC1 to ALC2 @@ -507,7 +497,6 @@ public void CheckContextUnloaded2() // Test may fail when running on a different runtime [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", TestRuntimes.Mono)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/34072", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] public static void Unload_TwoCollectibleWithOneAssemblyAndOneInstanceReferencingAnotherThroughGenericStatic() { // We create 2 collectible ALC, load one assembly in each, create one instance in the ALC2, diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/Dispose.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/Dispose.cs index e4fe6560cbacd3..803ebbb5edd6e5 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/Dispose.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/Dispose.cs @@ -169,7 +169,7 @@ public void Dispose_CallsVirtualDispose_TrueArg() Assert.False(disposeInvoked, "Expected finalizer to have been suppressed"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] public void Finalizer_CallsVirtualDispose_FalseArg() { bool disposeInvoked = false; @@ -345,24 +345,24 @@ public void VerifyAfterDispose() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] public void FinalizeFlushesWriteBuffer() => VerifyFlushedBufferOnFinalization( filePath => new FileStream(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite | FileShare.Delete, bufferSize: 4096, useAsync: false)); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] public void FinalizeFlushesWriteBufferForDerivedFileStreamWithFinalizerCreatedFromPath() => VerifyFlushedBufferOnFinalization( filePath => new DerivedFileStreamWithFinalizer(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite | FileShare.Delete, bufferSize: 4096, FileOptions.None)); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] public void FinalizeFlushesWriteBufferForDerivedFileStreamWithFinalizerCreatedFromSafeFileHandle() => VerifyFlushedBufferOnFinalization( filePath => new DerivedFileStreamWithFinalizer( File.OpenHandle(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite | FileShare.Delete, FileOptions.None), FileAccess.Write, bufferSize: 4096, isAsync: false)); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] public void FinalizeFlushesWriteBufferForDerivedFileStreamWithFinalizerCreatedFromIntPtr() => VerifyFlushedBufferOnFinalization( filePath => new DerivedFileStreamWithFinalizer( @@ -370,19 +370,19 @@ public void FinalizeFlushesWriteBufferForDerivedFileStreamWithFinalizerCreatedFr FileAccess.Write, ownsHandle: true)); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] public void FinalizeFlushesWriteBufferForDerivedFileStreamWithoutFinalizerCreatedFromPath() => VerifyFlushedBufferOnFinalization( filePath => new DerivedFileStreamWithoutFinalizer(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite | FileShare.Delete, bufferSize: 4096, FileOptions.None)); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] public void FinalizeFlushesWriteBufferForDerivedFileStreamWithoutFinalizerCreatedFromSafeFileHandle() => VerifyFlushedBufferOnFinalization( filePath => new DerivedFileStreamWithoutFinalizer( File.OpenHandle(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite | FileShare.Delete, FileOptions.None), FileAccess.Write, bufferSize: 4096, isAsync: false)); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] public void FinalizeFlushesWriteBufferForDerivedFileStreamWithoutFinalizerCreatedFromIntPtr() => VerifyFlushedBufferOnFinalization( filePath => new DerivedFileStreamWithoutFinalizer( diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index d6c4aed495b680..98a7a55e08b9c7 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -183,8 +183,15 @@ - + + + + + + + + From 6ce3ebeab1bc6d24dc2e5a9d33f9f9429f2c2740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Fri, 24 Apr 2026 09:42:49 +0000 Subject: [PATCH 5/6] Enable StackTrace tests on browser now that line number support is enabled Remove IsBrowser from [ActiveIssue] attributes for issue #50957 across StackTraceTests, StackFrameTests, and StackFrameExtensionsTests. These tests were disabled on browser because stack traces lacked PDB source/line info. With StackTraceLineNumberSupport now enabled for browser, these tests pass. The IsMonoAOT skip is retained where applicable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/StackFrameExtensionsTests.cs | 4 ++-- .../tests/StackFrameTests.cs | 8 ++++---- .../tests/StackTraceTests.cs | 15 +++++++-------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameExtensionsTests.cs b/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameExtensionsTests.cs index 931fe55adce172..bae51739e25262 100644 --- a/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameExtensionsTests.cs +++ b/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameExtensionsTests.cs @@ -44,7 +44,7 @@ public static IEnumerable HasMethod_TestData() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsILOffsetsSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [MemberData(nameof(HasMethod_TestData))] public void HasILOffset_Invoke_ReturnsExpected(StackFrame stackFrame, bool expected) { @@ -58,7 +58,7 @@ public void HasILOffset_NullStackFrame_ThrowsNullReferenceException() } [Theory] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [ActiveIssue("https://github.com/dotnet/runtime/issues/103218", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] [MemberData(nameof(HasMethod_TestData))] public void HasMethod_Invoke_ReturnsExpected(StackFrame stackFrame, bool expected) diff --git a/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameTests.cs b/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameTests.cs index 02689dede3a119..e7fc88815908ff 100644 --- a/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameTests.cs +++ b/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameTests.cs @@ -18,7 +18,7 @@ public void OffsetUnknown_Get_ReturnsNegativeOne() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] public void Ctor_Default() { var stackFrame = new StackFrame(); @@ -26,7 +26,7 @@ public void Ctor_Default() } [Theory] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [InlineData(true)] [InlineData(false)] public void Ctor_FNeedFileInfo(bool fNeedFileInfo) @@ -51,7 +51,7 @@ public void Ctor_SkipFrames_FNeedFileInfo(int skipFrames, bool fNeedFileInfo) } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] public void SkipFrames_CallMethod_ReturnsExpected() { StackFrame stackFrame = CallMethod(1); @@ -73,7 +73,7 @@ public void SkipFrames_ManyFrames_HasNoMethod(int skipFrames) } [Theory] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [InlineData(null, StackFrame.OFFSET_UNKNOWN)] [InlineData("", 0)] [InlineData("FileName", 1)] diff --git a/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs b/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs index aa57a823d25cf0..c7ea32bba21545 100644 --- a/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs +++ b/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs @@ -221,7 +221,7 @@ public void MethodsToSkip_Get_ReturnsZero() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] public void Ctor_Default() { var stackTrace = new StackTrace(); @@ -229,7 +229,7 @@ public void Ctor_Default() } [Theory] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [InlineData(true)] [InlineData(false)] public void Ctor_FNeedFileInfo(bool fNeedFileInfo) @@ -239,7 +239,7 @@ public void Ctor_FNeedFileInfo(bool fNeedFileInfo) } [Theory] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [InlineData(0)] [InlineData(1)] public void Ctor_SkipFrames(int skipFrames) @@ -263,7 +263,7 @@ public void Ctor_LargeSkipFrames_GetFramesReturnsEmpty() } [Theory] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [InlineData(0, true)] [InlineData(1, true)] [InlineData(0, false)] @@ -291,7 +291,7 @@ public void Ctor_LargeSkipFramesFNeedFileInfo_GetFramesReturnsEmpty(bool fNeedFi } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] public void Ctor_ThrownException_GetFramesReturnsExpected() { var stackTrace = new StackTrace(InvokeException()); @@ -309,7 +309,7 @@ public void Ctor_EmptyException_GetFramesReturnsEmpty() } [Theory] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [InlineData(true)] [InlineData(false)] public void Ctor_Bool_ThrownException_GetFramesReturnsExpected(bool fNeedFileInfo) @@ -332,7 +332,7 @@ public void Ctor_EmptyException_FNeedFileInfo(bool fNeedFileInfo) [Theory] [ActiveIssue("https://github.com/dotnet/runtime/issues/31796", TestRuntimes.Mono)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [InlineData(0)] [InlineData(1)] public void Ctor_Exception_SkipFrames(int skipFrames) @@ -652,7 +652,6 @@ public static IEnumerable Ctor_Async_TestData() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsRuntimeAsyncSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] [MemberData(nameof(Ctor_Async_TestData))] [MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)] public async Task ToString_Async(Func asyncMethod, string[] expectedPatterns) From 372851b98d3afbfacd65a438d81f5c84535a86ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Fri, 24 Apr 2026 12:27:03 +0000 Subject: [PATCH 6/6] Re-add [ActiveIssue] on ToString_Async for browser CoreCLR on browser-wasm does not produce file/line info in stack traces, so the ToString_Async tests that check for .cs:line patterns still need to be skipped on browser. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../System.Diagnostics.StackTrace/tests/StackTraceTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs b/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs index c7ea32bba21545..d466e0986ed29b 100644 --- a/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs +++ b/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs @@ -652,6 +652,7 @@ public static IEnumerable Ctor_Async_TestData() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsRuntimeAsyncSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] [MemberData(nameof(Ctor_Async_TestData))] [MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)] public async Task ToString_Async(Func asyncMethod, string[] expectedPatterns)