Repository navigation
Closed
Labels
Milestone
Description
System.IO.Tests.File_Move_Tests.File_Move_Multiple_From_Watched_To_Unwatched_Mac(filesCount: 1) [FAIL]
Expected events (3) count doesn't match triggered events count (1):
Deleted /var/folders/j1/76_p663903g5g2rg7ckqbv440000gy/T/File_Move_Tests_hepan0n0.4wy/FileMove_Multiple_FromWatchedToUnwatched_192_9877436f/dir_watched/file0
Expected: True
Actual: False
Stack Trace:
/_/src/System.IO.FileSystem.Watcher/tests/Utility/FileSystemWatcherTest.cs(558,0): at System.IO.Tests.FileSystemWatcherTest.ExpectEvents(FileSystemWatcher watcher, Int32 expectedEvents, Action action)
/_/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.Move.cs(216,0): at System.IO.Tests.File_Move_Tests.FileMove_Multiple_FromWatchedToUnwatched(Int32 filesCount, Boolean skipOldEvents)
/_/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.Move.cs(43,0): at System.IO.Tests.File_Move_Tests.File_Move_Multiple_From_Watched_To_Unwatched_Mac(Int32 filesCount)
cloning from discussion in #31383
This test assumes that we will always get incorrect Create event in OSX but that seems to happen only sometimes. We should update test to either wait for Crete events first, ignore them and be able to deal with both cases.
Further more, I did test run on unsupported FreeBSD and I got expected events in different order.
/usr/home/furt/git/wfurt-corefx/artifacts/bin/System.IO.FileSystem.Watcher.Tests/netcoreapp-FreeBSD-Debug ~/git/wfurt-corefx/src/System.IO.FileSystem.Watcher/tests
Discovering: System.IO.FileSystem.Watcher.Tests (method display = ClassAndMethod, method display options = None)
Discovered: System.IO.FileSystem.Watcher.Tests (found 147 of 183 test cases)
Starting: System.IO.FileSystem.Watcher.Tests (parallel test collections = on, max threads = 2)
System.IO.Tests.File_Move_Tests.File_Move_Multiple_From_Unwatched_To_WatchedMac(filesCount: 3) [FAIL]
Assert.Equal() Failure
Expected: SelectArrayIterator<<>f__AnonymousType1<String, String>, FiredEvent> [Created /tmp/File_Move_Tests_jviqx2cg.0d2/FileMove_Multiple_FromUnwatchedToWatched_233_249fe60e/dir_watched/file0 , Created /tmp/File_Move_Tests_jviqx2cg.0d2/FileMove_Multiple_FromUnwatchedToWatched_233_249fe60e/dir_watched/file1 , Created /tmp/File_Move_Tests_jviqx2cg.0d2/FileMove_Multiple_FromUnwatchedToWatched_233_249fe60e/dir_watched/file2 ]
Actual: List<FiredEvent> [Created /tmp/File_Move_Tests_jviqx2cg.0d2/FileMove_Multiple_FromUnwatchedToWatched_233_249fe60e/dir_watched/file0 , Created /tmp/File_Move_Tests_jviqx2cg.0d2/FileMove_Multiple_FromUnwatchedToWatched_233_249fe60e/dir_watched/file2 , Created /tmp/File_Move_Tests_jviqx2cg.0d2/FileMove_Multiple_FromUnwatchedToWatched_233_249fe60e/dir_watched/file1 ]
Stack Trace:
/usr/home/furt/git/wfurt-corefx/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.Move.cs(253,0): at System.IO.Tests.File_Move_Tests.FileMove_Multiple_FromUnwatchedToWatched(Int32 filesCount)
/usr/home/furt/git/wfurt-corefx/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.Move.cs(62,0): at System.IO.Tests.File_Move_Tests.File_Move_Multiple_From_Unwatched_To_WatchedMac(Int32 filesCount)
Finished: System.IO.FileSystem.Watcher.Tests
=== TEST EXECUTION SUMMARY ===
System.IO.FileSystem.Watcher.Tests Total: 267, Errors: 0, Failed: 1, Skipped: 0, Time: 3.360s
This may be be product bug or limitation but it is another example where test seems too strict.
cc: @aik-jahoda
Activity
aik-jahoda commentedon Nov 11, 2019
I'll update the test helper it doesn't assert to fired event count. It is up to the test itself to interprets the events.
stephentoub commentedon Jan 23, 2020
@aik-jahoda, there's still a test disabled against this issue:
runtime/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Directory.Move.cs
Lines 29 to 35 in 04f2226