[mac] Support coalesced fsevents (#734)
* Add `is_coalesced` property to `NativeEvent`
So that we can effectively decide if we need to perform additional
system calls to figure out what really happened.
* Replace `NativeEvent._event_type` with `repr()` support
It's more pythonic, and the `_event_type` implementation wasn't quite
usable anyway.
NB: the representation is not truly copy/paste python code if there is
a double quote inside event.path, but that should be a rare case so we
don't add the expensive special case handling there.
* Allow running tests with debugger attached
Some Python debuggers create additional threads, so we shouldn't assume that there is only one.
* Request notifications for watched root
* Expect events on macOS instead of using `time.sleep()`
It might be even better to check for the emitter class, as opposed to platform
* Add exception handling to FSEventsEmitter
Reduce the amount of 'silent breakage'
* Use sentinel event when setting up tests on macOS
So that we can avoid a race between test setup and fseventsd
* Improve handling of coalesced events
* Revert accidental platform check change
* Fix renaming_top_level_directory test on macOS
* Generate sub events for move operations
* Remove `filesystem_view` again
While the `filesystem_view` helps with filtering out additional
`FileCreatedEvent`+`DirModifiedEvent` pairs then it also introduces
a huge amount of edge cases for synthetic events caused by move and
rename operations. On top of that, in order to properly resolve
those edge cases we'd have to go back to a solution very similar to
the old directory snapshots, with all the performance penalties they
suffered from...
As such I think it's better to acknowledge the behaviour for coalesced
events instead, and thus remove the `filesystem_view` again.
* Update Changelog
6 files changed