Skip to content

Commit

Permalink
Use a ManualResetEvent in TestSubFileSystem.TestWatcherCaseSensitive
Browse files Browse the repository at this point in the history
A bit friendlier for CI runners
  • Loading branch information
Metapyziks committed Jun 21, 2024
1 parent d32ef47 commit a68e9e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Zio.Tests/FileSystems/TestSubFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,22 @@ public void TestWatcherCaseSensitive(string physicalDir, string subDir, string f

var subFs = new SubFileSystem(physicalFs, subDir);
var watcher = subFs.Watch("/");
var waitHandle = new ManualResetEvent(false);

var gotChange = false;
watcher.Created += (sender, args) =>
{
if (args.FullPath == filePath)
{
gotChange = true;
waitHandle.Set();
}
};

watcher.IncludeSubdirectories = true;
watcher.EnableRaisingEvents = true;

physicalFs.WriteAllText($"{physicalDir}{filePath}", "test");
Thread.Sleep(100);
Assert.True(gotChange);

Assert.True(waitHandle.WaitOne(100));
}

[SkippableFact]
Expand Down

0 comments on commit a68e9e9

Please sign in to comment.