diff options
author | Jan Korous <jkorous@apple.com> | 2019-08-01 23:24:30 +0000 |
---|---|---|
committer | Jan Korous <jkorous@apple.com> | 2019-08-01 23:24:30 +0000 |
commit | 9debb024d44db54b9453459d3bd98d28c20a163f (patch) | |
tree | 9eedad994306a24bb1e8db0e482b4bac7c783827 /clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp | |
parent | d544d1441d98308eeea98969c3311bbd24fd6b0f (diff) | |
download | bcm5719-llvm-9debb024d44db54b9453459d3bd98d28c20a163f.tar.gz bcm5719-llvm-9debb024d44db54b9453459d3bd98d28c20a163f.zip |
[DirectoryWatcher] Relax assumption to prevent test flakiness
llvm-svn: 367632
Diffstat (limited to 'clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp')
-rw-r--r-- | clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp b/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp index 3df79ac48a4..ae3cb614163 100644 --- a/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp +++ b/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp @@ -25,6 +25,24 @@ static void stopFSEventStream(FSEventStreamRef); namespace { +/// This implementation is based on FSEvents API which implementation is +/// aggressively coallescing events. This can manifest as duplicate events. +/// +/// For example this scenario has been observed: +/// +/// create foo/bar +/// sleep 5 s +/// create DirectoryWatcherMac for dir foo +/// receive notification: bar EventKind::Modified +/// sleep 5 s +/// modify foo/bar +/// receive notification: bar EventKind::Modified +/// receive notification: bar EventKind::Modified +/// sleep 5 s +/// delete foo/bar +/// receive notification: bar EventKind::Modified +/// receive notification: bar EventKind::Modified +/// receive notification: bar EventKind::Removed class DirectoryWatcherMac : public clang::DirectoryWatcher { public: DirectoryWatcherMac( |