]> go.fuhry.dev Git - fsnotify.git/commit
kqueue: fix removing a directory
authorMartin Tournoij <martin@arp242.net>
Sun, 16 Oct 2022 19:28:33 +0000 (21:28 +0200)
committerMartin Tournoij <martin@arp242.net>
Wed, 16 Nov 2022 02:04:50 +0000 (03:04 +0100)
commit2b69a9cf3768563f7df47035be626dcfa8389f9d
treed0b531d2e63c10176395263d319734071689259d
parent7ed195facfcd33fc8a54c731565fbbe1f959edd6
kqueue: fix removing a directory

Fix regression from #526, which would sometimes fail with something
along the lines of:

    --- FAIL: TestWatchRm/remove_watched_directory (1.30s)
        helpers_test.go:384: fsnotify.sendDirectoryChangeEvents: open /tmp/TestWatchRmremove_watched_directory2055111636/001: no such file or directory
        fsnotify_test.go:750:
            have:
             REMOVE               "/a"
             REMOVE               "/b"
             REMOVE               "/c"
             REMOVE               "/d"
             REMOVE               "/e"
             REMOVE               "/f"
             REMOVE               "/g"
            want:
             REMOVE               "/"
             REMOVE               "/a"
             REMOVE               "/b"
             REMOVE               "/c"
             REMOVE               "/d"
             REMOVE               "/e"
             REMOVE               "/f"
             REMOVE               "/g"
             REMOVE               "/h"
             REMOVE               "/i"
             REMOVE               "/j"

We can just always ignore a directory no longer existing; kqueue should
still send the correct events.

Also noticed the error on sendFileCreatedEventIfNew() wasn't really
being sent properly, so deal with that as well.
CHANGELOG.md
backend_kqueue.go