From 15845593fd6ccccc577df64fcc9792f03ac2e594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Fri, 22 Mar 2024 15:11:20 +0100 Subject: [PATCH 1/2] Avoid skipping brittle tests in FileSystemWatcher --- .../FileSystem/FileSystemWatcher/Tests.cs | 4 ---- .../FileSystem/FileSystemWatcher/WaitForChangedTests.cs | 4 ---- 2 files changed, 8 deletions(-) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs index 96dbd2dc0..b22cfcca0 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs @@ -15,8 +15,6 @@ public abstract partial class Tests [AutoData] public void BeginInit_ShouldStopListening(string path) { - SkipIfBrittleTestsShouldBeSkipped(); - FileSystem.Initialize(); using ManualResetEventSlim ms = new(); using IFileSystemWatcher fileSystemWatcher = @@ -68,8 +66,6 @@ public void Container_ShouldBeInitializedWithNull() [AutoData] public void EndInit_ShouldRestartListening(string path) { - SkipIfBrittleTestsShouldBeSkipped(); - FileSystem.Initialize(); using ManualResetEventSlim ms = new(); using IFileSystemWatcher fileSystemWatcher = diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs index d49985593..d9dcedd1f 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs @@ -14,8 +14,6 @@ public abstract partial class WaitForChangedTests [AutoData] public void WaitForChanged_ShouldBlockUntilEventHappens(string path) { - SkipIfBrittleTestsShouldBeSkipped(); - using ManualResetEventSlim ms = new(); using IFileSystemWatcher fileSystemWatcher = FileSystem.FileSystemWatcher.New(BasePath); @@ -54,8 +52,6 @@ public void WaitForChanged_ShouldBlockUntilEventHappens(string path) public void WaitForChanged_Timeout_ShouldReturnTimedOut(string path, Func callback) { - SkipIfBrittleTestsShouldBeSkipped(); - using ManualResetEventSlim ms = new(); using IFileSystemWatcher fileSystemWatcher = FileSystem.FileSystemWatcher.New(BasePath); From e5294f73b9faacced41f824f7447cdaddfef697a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Fri, 22 Mar 2024 15:46:01 +0100 Subject: [PATCH 2/2] Avoid skipping brittle tests in `IncludeSubdirectoriesTests` --- .../FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs index 1cc8072c3..26c54827d 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs @@ -3,6 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; +// ReSharper disable AccessToDisposedClosure // ReSharper disable once PartialTypeWithSinglePart public abstract partial class IncludeSubdirectoriesTests : FileSystemTestBase @@ -65,8 +66,6 @@ public void public void IncludeSubdirectories_SetToTrue_ShouldTriggerNotificationOnSubdirectories( string baseDirectory, string subdirectoryName) { - SkipIfBrittleTestsShouldBeSkipped(!Test.RunsOnWindows); - FileSystem.Initialize() .WithSubdirectory(baseDirectory).Initialized(s => s .WithSubdirectory(subdirectoryName));