Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatability: System.IO.FileSystem.Watcher.Tests failing on new Mac OSX 10.15 #40034

Open
buyaa-n opened this issue Aug 5, 2019 · 14 comments

Comments

@buyaa-n
Copy link
Member

commented Aug 5, 2019

One test failing from System.IO.FileSystem.Watcher.Tests on Mac Catalina:

<test name="System.IO.Tests.File_Move_Tests.File_Move_From_Unwatched_To_Watched" type="System.IO.Tests.File_Move_Tests" method="File_Move_From_Unwatched_To_Watched" time="4.1481931" result="Fail">
        <failure exception-type="Xunit.Sdk.TrueException">
          <message><![CDATA[Created event did not occur as expected\nExpected: True\nActual:   False]]></message>
          <stack-trace><![CDATA[   at System.IO.Tests.FileSystemWatcherTest.ExecuteAndVerifyEvents(FileSystemWatcher watcher, WatcherChangeTypes expectedEvents, Action action, Boolean assertExpected, String[] expectedPaths, Int32 timeout) in /Users/dotnet/Documents/dotnet/corefx/src/System.IO.FileSystem.Watcher/tests/Utility/FileSystemWatcherTest.cs:line 272
   at System.IO.Tests.FileSystemWatcherTest.ExpectEvent(FileSystemWatcher watcher, WatcherChangeTypes expectedEvents, Action action, Action cleanup, String[] expectedPaths, Int32 attempts, Int32 timeout) in /Users/dotnet/Documents/dotnet/corefx/src/System.IO.FileSystem.Watcher/tests/Utility/FileSystemWatcherTest.cs:line 182
   at System.IO.Tests.FileSystemWatcherTest.ExpectEvent(FileSystemWatcher watcher, WatcherChangeTypes expectedEvents, Action action, Action cleanup, String expectedPath, Int32 attempts, Int32 timeout) in /Users/dotnet/Documents/dotnet/corefx/src/System.IO.FileSystem.Watcher/tests/Utility/FileSystemWatcherTest.cs:line 152
   at System.IO.Tests.File_Move_Tests.FileMove_FromUnwatchedToWatched(WatcherChangeTypes eventType) in /Users/dotnet/Documents/dotnet/corefx/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.Move.cs:line 164
   at System.IO.Tests.File_Move_Tests.File_Move_From_Unwatched_To_Watched() in /Users/dotnet/Documents/dotnet/corefx/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.Move.cs:line 55]]></stack-trace>
        </failure>
      </test>
@danmosemsft

This comment has been minimized.

Copy link
Member

commented Aug 5, 2019

Is this consistently failing on Catalina? Is it consistently passing on MOjave?

@buyaa-n

This comment has been minimized.

Copy link
Member Author

commented Aug 5, 2019

Constantly failing on Catalina for all branches. Run tests on Mojave only once and it didn't fail

@danmosemsft

This comment has been minimized.

Copy link
Member

commented Aug 5, 2019

OK. I think this is a low priority to investigate as long as the other tests in this area pass.

cc @JeremyKuhne in case he thinks this is of 3.0 concern.

@JeremyKuhne JeremyKuhne added this to the 5.0 milestone Aug 5, 2019

@danmosemsft

This comment has been minimized.

Copy link
Member

commented Aug 6, 2019

@buyaa-n can you please put up a gist with the full results for this library, it might make it clearer what's special about this one.

Also you might re-run with the security setting that makes the memory mapped files tests pass. That would be interesting

@buyaa-n

This comment has been minimized.

Copy link
Member Author

commented Aug 6, 2019

@buyaa-n can you please put up a gist with the full results for this library, it might make it clearer what's special about this one.

Here: https://gist.github.com/buyaa-n/94e359347d2a88bd44a5afc2f57f5ad8

Also you might re-run with the security setting that makes the memory mapped files tests pass. That would be interesting

I did run all tests but that change didn't fixed this. But i still suspect there is some other security restriction as i tried to find out what event it is firing instead of Create, turns out it is not firing any event. I have increased timeout long enough, still not firing any event, guess that means the file didn't move at all

@krwq

This comment has been minimized.

Copy link
Member

commented Aug 6, 2019

FYI: also reproes on my Catalina

@buyaa-n

This comment has been minimized.

Copy link
Member Author

commented Aug 9, 2019

The file were moved successfully, just Created event is not get fired anymore for File.Move(source, target) action (though Deleted event still firing for old path). For 10.15 only, i am thinking to disable this test for Mac OS for now as fix for this would need more effort and most likely area the area owners look into it.
How this sounds @JeremyKuhne @danmosemsft

@danmosemsft

This comment has been minimized.

Copy link
Member

commented Aug 9, 2019

Does this affect the customer. In other words does the customer get exposed to this kind of variation or is FSW supposed to be hiding it from them..

@buyaa-n

This comment has been minimized.

Copy link
Member Author

commented Aug 9, 2019

As it is a public class and public API it could impact customers in case they have event handler listening for Create event. As far as i seen File.Move(source, target) action should trigger Create event for target path and Delete event for source path, which the test is testing and failing for Create event. FSW is exposing/triggering this events for customer's use, so it is a valid bug need to be fixed. I am not sure if I should keep looking and try to fix the bug or hand it to the owner and disable the test until it fixed. Of course I could continue looking, but not sure how fast be able to solve it

@buyaa-n

This comment has been minimized.

Copy link
Member Author

commented Aug 14, 2019

Turns out Mac OS not triggering Create event for File.Move(source, target) action which it was triggering in previous versions on OSX like this:
kFSEventStreamEventFlagItemCreated, kFSEventStreamEventFlagItemIsFile, kFSEventStreamEventFlagItemIsHardlink
But OSX 10.15 is triiggering only kFSEventStreamEventFlagRootChanged instead of above. I am not sure if this could be counted as OS bug or it is by their design and we need to adjust our event parsers accordingly. For me it seems OS bug, if that is the case there is nothing to do about it from corefx side

@krwq

This comment has been minimized.

Copy link
Member

commented Aug 14, 2019

@buyaa-n does the documentation say anything about this behavior? I'd recommend disabling the tests first and once you're done with filing issues then start looking at them 1 by 1 focusing on areas you own or co-own and for the remainder limit the time you spend on them (if you have 60 issues it probably doesn't make sense to spend more than an 1h on 1)

@buyaa-n

This comment has been minimized.

Copy link
Member Author

commented Aug 14, 2019

@buyaa-n does the documentation say anything about this behavior?

Docs i have seen so far doesn't say specifically say what File.Move() should trigger

I'd recommend disabling the tests first and once you're done with filing issues then start looking at them 1 by 1 focusing on areas you own or co-own and for the remainder limit the time you spend on them (if you have 60 issues it probably doesn't make sense to spend more than an 1h on 1)

Well actually this is the last open issue i have created for Mac compatablity 😄, have already spent some time on it, and above result is end of my investigation, yeah am not planning to go further and @JeremyKuhne suggested the same plus mark the issue up for grabs, i will disable OSX test with a link to this issue

@buyaa-n

This comment has been minimized.

Copy link
Member Author

commented Aug 15, 2019

After it's fixed please remove OS version conditional check from the test https://github.com/dotnet/corefx/pull/40332/files#diff-738a1650d713fef5b8711a5e00967ecdR57

@krwq krwq added the disabled-test label Aug 16, 2019

@BrennanConroy

This comment has been minimized.

Copy link
Contributor

commented Aug 21, 2019

👀
This is failing a dotnet-watch test in ASP.NET Core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.