Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kqueue: fix removing a directory #537

Merged
merged 3 commits into from Nov 16, 2022
Merged

kqueue: fix removing a directory #537

merged 3 commits into from Nov 16, 2022

Conversation

arp242
Copy link
Member

@arp242 arp242 commented Nov 16, 2022

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.

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.
@arp242 arp242 force-pushed the fix-526 branch 2 times, most recently from b440d19 to 771c4ba Compare November 16, 2022 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant