Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ public static IEnumerable<object[]> Ctor_Async_TestData()
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsRuntimeAsyncSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/50957", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))]
Comment thread
maraf marked this conversation as resolved.
[MemberData(nameof(Ctor_Async_TestData))]
[MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]
public async Task ToString_Async(Func<Task> asyncMethod, string[] expectedPatterns)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -345,44 +345,44 @@ 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(
File.OpenHandle(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite | FileShare.Delete, FileOptions.None).DangerousGetHandle(),
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(
Expand Down
9 changes: 1 addition & 8 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,8 @@
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.IO.FileSystem.Tests\DisabledFileLockingTests\System.IO.FileSystem.DisabledFileLocking.Tests.csproj" />
</ItemGroup>

<!-- https://github.com/dotnet/runtime/issues/125495 - These tests are disabled on browser/CoreCLR because of build errors and test failures. -->
<!-- https://github.com/dotnet/runtime/issues/125495 - These tests are disabled on browser/CoreCLR because of crashes and test failures. -->
<ItemGroup Condition="'$(TargetOS)' == 'browser' and '$(RuntimeFlavor)' == 'CoreCLR' and '$(RunDisabledWasmTests)' != 'true'">
<!-- build errors, WasmTriggerPublishApp for CoreCLR not implemented -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.IO.FileSystem.Tests\System.IO.FileSystem.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.MetadataLoadContext\tests\System.Reflection.MetadataLoadContext.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.Metadata\tests\System.Reflection.Metadata.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Loader\tests\System.Runtime.Loader.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Diagnostics.StackTrace\tests\System.Diagnostics.StackTrace.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Reflection.Tests\System.Reflection.Tests.csproj" />
<!-- crashes -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.DependencyInjection\tests\DI.Tests\Microsoft.Extensions.DependencyInjection.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.VisualBasic.Core\tests\Microsoft.VisualBasic.Core.Tests.csproj" />
Comment thread
maraf marked this conversation as resolved.
Expand Down
Loading