dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.47k stars 4.76k forks source link

strange message while running FileSystem.Watcher tests on MacOS #4709

Open wfurt opened 4 years ago

wfurt commented 4 years ago

This happened to me twice last week. As far as I know, the message do not come from our code and there are questions about similar errors on the Internet.

==================================
  ~/github/wfurt-runtime/artifacts/bin/System.IO.FileSystem.Watcher.Tests/netcoreapp5.0-OSX-Debug ~/github/wfurt-runtime/src/libraries/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 170 of 184 test cases)
    Starting:    System.IO.FileSystem.Watcher.Tests (parallel test collections = on, max threads = 8)
  2020-01-30 14:22 dotnet[60684] (FSEvents.framework) process_dir_events: watch_path: error trying to add kqueue for fd 165 (/private/var/folders/z6/nnqqzwmd6lz3dttlnjp_vgp00000gn/T/FileSystemWatcherTests_netstandard17_eplontif.jja; Bad file descriptor)
  2020-01-30 14:22 dotnet[60684] (FSEvents.framework) process_dir_events: watch_path: error removing fd 170 from kqueue (Bad file descriptor)
  2020-01-30 14:22 dotnet[60684] (FSEvents.framework) process_dir_events: watch_all_parents: error trying to add kqueue for fd 166 (/private/var/folders/z6/nnqqzwmd6lz3dttlnjp_vgp00000gn/T; Bad file descriptor)
  2020-01-30 14:22 dotnet[60684] (FSEvents.framework) process_dir_events: watch_all_parents: error trying to add kqueue for fd 169 (/private/var/folders/z6/nnqqzwmd6lz3dttlnjp_vgp00000gn; Bad file descriptor)
  2020-01-30 14:22 dotnet[60684] (FSEvents.framework) process_dir_events: watch_all_parents: error trying to add kqueue for fd 170 (/private/var/folders/z6; Bad file descriptor)
  2020-01-30 14:22 dotnet[60684] (FSEvents.framework) process_dir_events: watch_all_parents: error trying to add kqueue for fd 171 (/private/var/folders; Bad file descriptor)
  2020-01-30 14:22 dotnet[60684] (FSEvents.framework) process_dir_events: watch_all_parents: error trying to add kqueue for fd 172 (/private/var; Bad file descriptor)
  2020-01-30 14:22 dotnet[60684] (FSEvents.framework) process_dir_events: watch_all_parents: error trying to add kqueue for fd 173 (/private; Bad file descriptor)

This may explain some stability issues with test runs on OSX.

cc: @aik-jahoda

JeremyKuhne commented 4 years ago

Triage: @aik-jahoda Any thoughts on the message above?

aik-jahoda commented 4 years ago

Only one thought is that there is that the file in the watched directory was deleted before then it tries process invalid fd. However strange is that all parent directories have a bad descriptor as I expect they were not deleted during a test.

Does it print for one test or is it random?