Skip to content

Commit

Permalink
Disable more flaky FSW tests for Windows (#105638)
Browse files Browse the repository at this point in the history
  • Loading branch information
jozkee authored Jul 30, 2024
1 parent ed08356 commit 35b94da
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace System.IO.Tests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public class Directory_Changed_Tests : FileSystemWatcherTest
{
[Fact]
Expand Down Expand Up @@ -78,7 +79,6 @@ public void FileSystemWatcher_Directory_Changed_SymLink()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_Directory_Changed_SynchronizingObject()
{
string dir = CreateTestDirectory(TestDirectory, "dir");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace System.IO.Tests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public class Directory_Create_Tests : FileSystemWatcherTest
{
[Fact]
Expand All @@ -31,7 +32,6 @@ public void FileSystemWatcher_Directory_PathNotExists()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_Directory_Create()
{
using (var watcher = new FileSystemWatcher(TestDirectory))
Expand All @@ -47,7 +47,6 @@ public void FileSystemWatcher_Directory_Create()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_Directory_Create_InNestedDirectory()
{
string nestedDir = CreateTestDirectory(TestDirectory, "dir1", "nested");
Expand Down Expand Up @@ -100,7 +99,6 @@ public void FileSystemWatcher_Directory_Create_SymLink()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_Directory_Create_SynchronizingObject()
{
using (var watcher = new FileSystemWatcher(TestDirectory))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace System.IO.Tests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public class Directory_Delete_Tests : FileSystemWatcherTest
{
[Fact]
Expand Down Expand Up @@ -64,7 +65,6 @@ public void FileSystemWatcher_Directory_Delete_DeepDirectoryStructure()
}

[ConditionalFact(typeof(MountHelper), nameof(MountHelper.CanCreateSymbolicLinks))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_Directory_Delete_SymLink()
{
string dir = CreateTestDirectory(TestDirectory, "dir");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace System.IO.Tests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public class Directory_Move_Tests : FileSystemWatcherTest
{
[Fact]
Expand Down Expand Up @@ -77,7 +78,6 @@ public void Unix_Directory_Move_To_Different_Watched_Directory()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void Directory_Move_From_Unwatched_To_Watched()
{
DirectoryMove_FromUnwatchedToWatched(WatcherChangeTypes.Created);
Expand All @@ -86,7 +86,6 @@ public void Directory_Move_From_Unwatched_To_Watched()
[Theory]
[InlineData(false)]
[InlineData(true)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void Directory_Move_In_Nested_Directory(bool includeSubdirectories)
{
DirectoryMove_NestedDirectory(includeSubdirectories ? WatcherChangeTypes.Renamed : 0, includeSubdirectories);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace System.IO.Tests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public partial class Directory_NotifyFilter_Tests : FileSystemWatcherTest
{
[LibraryImport("advapi32.dll", EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
Expand All @@ -21,7 +22,6 @@ private static partial uint SetSecurityInfoByHandle( string name, uint objectTyp

[Theory]
[MemberData(nameof(FilterTypes))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_Directory_NotifyFilter_Attributes(NotifyFilters filter)
{
FileSystemWatcherTest.Execute(() =>
Expand Down Expand Up @@ -117,7 +117,6 @@ public void FileSystemWatcher_Directory_NotifyFilter_LastAccessTime(NotifyFilter

[Theory]
[MemberData(nameof(FilterTypes))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_Directory_NotifyFilter_LastWriteTime(NotifyFilters filter)
{
string dir = CreateTestDirectory(TestDirectory, "dir");
Expand Down Expand Up @@ -167,7 +166,6 @@ public void FileSystemWatcher_Directory_NotifyFilter_LastWriteTime_TwoFilters(No
[Theory]
[MemberData(nameof(FilterTypes))]
[PlatformSpecific(TestPlatforms.Windows)] // Uses P/Invokes to set security info
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_Directory_NotifyFilter_Security(NotifyFilters filter)
{
string dir = CreateTestDirectory(TestDirectory, "dir");
Expand Down Expand Up @@ -225,7 +223,6 @@ public void FileSystemWatcher_Directory_NotifyFilter_LastWriteAndFileName()
/// after each other.
/// </summary>
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_Directory_NotifyFilter_ModifyAndCreate()
{
string dir = CreateTestDirectory(TestDirectory, "dir");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

namespace System.IO.Tests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public class File_Changed_Tests : FileSystemWatcherTest
{
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_File_Changed_LastWrite()
{
string file = CreateTestFile(TestDirectory, "file");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace System.IO.Tests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public class File_Create_Tests : FileSystemWatcherTest
{
[Fact]
Expand Down Expand Up @@ -85,7 +86,6 @@ public void FileSystemWatcher_File_Create_ForcedRestart()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_File_Create_InNestedDirectory()
{
string nestedDir = CreateTestDirectory(TestDirectory, "dir1", "nested");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

namespace System.IO.Tests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public class File_Delete_Tests : FileSystemWatcherTest
{
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_File_Delete()
{
using (var watcher = new FileSystemWatcher(TestDirectory))
Expand All @@ -28,7 +28,6 @@ public void FileSystemWatcher_File_Delete()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_File_Delete_ForcedRestart()
{
using (var watcher = new FileSystemWatcher(TestDirectory))
Expand All @@ -49,7 +48,6 @@ public void FileSystemWatcher_File_Delete_ForcedRestart()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_File_Delete_InNestedDirectory()
{
string nestedDir = CreateTestDirectory(TestDirectory, "dir1", "nested");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

namespace System.IO.Tests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public class File_Move_Tests : FileSystemWatcherTest
{
[Fact]
[PlatformSpecific(TestPlatforms.Windows)] // Expected WatcherChangeTypes are different based on OS
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void Windows_File_Move_To_Same_Directory()
{
FileMove_SameDirectory(WatcherChangeTypes.Renamed);
Expand Down Expand Up @@ -127,7 +127,6 @@ public void Unix_File_Move_With_Set_NotifyFilter()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void File_Move_SynchronizingObject()
{
string dir = CreateTestDirectory(TestDirectory, "dir");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace System.IO.Tests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public partial class File_NotifyFilter_Tests : FileSystemWatcherTest
{
[LibraryImport("advapi32.dll", EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
Expand Down Expand Up @@ -139,7 +140,6 @@ public void FileSystemWatcher_File_NotifyFilter_LastWriteTime(NotifyFilters filt

[Theory]
[MemberData(nameof(FilterTypes))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_File_NotifyFilter_Size(NotifyFilters filter)
{
string file = CreateTestFile(TestDirectory, "file");
Expand Down Expand Up @@ -194,7 +194,6 @@ public void FileSystemWatcher_File_NotifyFilter_Size_TwoFilters(NotifyFilters fi
[Theory]
[MemberData(nameof(FilterTypes))]
[PlatformSpecific(TestPlatforms.Windows)] // Uses P/Invokes to set security info
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_File_NotifyFilter_Security(NotifyFilters filter)
{
string file = CreateTestFile(TestDirectory, "file");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace System.IO.Tests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public class InternalBufferSizeTests : FileSystemWatcherTest
{
// FSW works by calling ReadDirectoryChanges asynchronously, processing the changes
Expand Down Expand Up @@ -74,7 +75,6 @@ public void FileSystemWatcher_InternalBufferSize(bool setToHigherCapacity)
[Fact]
[PlatformSpecific(TestPlatforms.Windows)]
[OuterLoop("A little slow")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_InternalBufferSize_SynchronizingObject()
{
ManualResetEvent unblockHandler = new ManualResetEvent(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public void FileSystemWatcher_SymbolicLink_TargetsDirectory_Create()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_SymbolicLink_TargetsDirectory_Create_IncludeSubdirectories()
{
FileSystemWatcherTest.Execute(() =>
Expand Down Expand Up @@ -112,6 +113,7 @@ public void FileSystemWatcher_SymbolicLink_TargetsDirectory_Create_IncludeSubdir

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/70450", TestPlatforms.OSX)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_SymbolicLink_IncludeSubdirectories_DoNotDereferenceChildLink()
{
// Arrange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public void BeginInit_PausesEnableRaisingEvents()
[Theory]
[InlineData(true)]
[InlineData(false)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void EndInit_ResumesPausedEnableRaisingEvents(bool setBeforeBeginInit)
{
FileSystemWatcherTest.Execute(() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ public void FileSystemWatcher_OnCreated()

[Fact]
[PlatformSpecific(TestPlatforms.OSX | TestPlatforms.Windows)] // Casing matters on Linux
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_OnCreatedWithMismatchedCasingGivesExpectedFullPath()
{
using (var fsw = new FileSystemWatcher(TestDirectory))
Expand Down Expand Up @@ -455,6 +456,7 @@ public void FileSystemWatcher_OnRenamed()

[Fact]
[PlatformSpecific(TestPlatforms.Windows)] // Unix FSW don't trigger on a file rename.
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_Windows_OnRenameGivesExpectedFullPath()
{
string file = CreateTestFile(TestDirectory, "file");
Expand Down Expand Up @@ -932,6 +934,7 @@ public void SetAndGetFiltersProperty()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_File_Delete_MultipleFilters()
{
// Check delete events against multiple filters
Expand All @@ -956,6 +959,7 @@ public void FileSystemWatcher_File_Delete_MultipleFilters()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_Directory_Create_MultipleFilters()
{
FileSystemWatcherTest.Execute(() =>
Expand All @@ -980,6 +984,7 @@ public void FileSystemWatcher_Directory_Create_MultipleFilters()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_Directory_Create_Filter_Ctor()
{
FileSystemWatcherTest.Execute(() =>
Expand Down Expand Up @@ -1023,6 +1028,7 @@ public void FileSystemWatcher_Directory_Delete_MultipleFilters()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_File_Create_MultipleFilters()
{
FileSystemWatcherTest.Execute(() =>
Expand All @@ -1045,6 +1051,7 @@ public void FileSystemWatcher_File_Create_MultipleFilters()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_ModifyFiltersConcurrentWithEvents()
{
FileSystemWatcherTest.Execute(() =>
Expand Down Expand Up @@ -1096,6 +1103,7 @@ public DangerousFileSystemWatcherTests(ITestOutputHelper output)
[PlatformSpecific(TestPlatforms.Linux)] // Reads MaxUsersWatches from Linux OS files
[OuterLoop("This test will use all available watchers and can cause failures in other concurrent tests or system processes.")]
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)]
public void FileSystemWatcher_CreateManyConcurrentWatches()
{
int maxUserWatches = int.Parse(File.ReadAllText("/proc/sys/fs/inotify/max_user_watches"));
Expand Down

0 comments on commit 35b94da

Please sign in to comment.