{"action":"opened","number":375,"pull_request":{"url":"https://api.github.com/repos/gorakhargosh/watchdog/pulls/375","id":86628359,"html_url":"https://github.com/gorakhargosh/watchdog/pull/375","diff_url":"https://github.com/gorakhargosh/watchdog/pull/375.diff","patch_url":"https://github.com/gorakhargosh/watchdog/pull/375.patch","issue_url":"https://api.github.com/repos/gorakhargosh/watchdog/issues/375","number":375,"state":"open","locked":false,"title":"Inotify event order/duplication, fix #117 and #233","user":{"login":"danilobellini","id":2096474,"avatar_url":"https://avatars.githubusercontent.com/u/2096474?v=3","gravatar_id":"","url":"https://api.github.com/users/danilobellini","html_url":"https://github.com/danilobellini","followers_url":"https://api.github.com/users/danilobellini/followers","following_url":"https://api.github.com/users/danilobellini/following{/other_user}","gists_url":"https://api.github.com/users/danilobellini/gists{/gist_id}","starred_url":"https://api.github.com/users/danilobellini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danilobellini/subscriptions","organizations_url":"https://api.github.com/users/danilobellini/orgs","repos_url":"https://api.github.com/users/danilobellini/repos","events_url":"https://api.github.com/users/danilobellini/events{/privacy}","received_events_url":"https://api.github.com/users/danilobellini/received_events","type":"User","site_admin":false},"body":"Add 2 new tests that addresses #117 and #233, fix them and fix a `DirDeletedEvent` duplication found on Linux when deleting a directory:\r\n\r\n- Fix the issue by removing the `observers.inotify_c.Inotify._remove_watch_bookkeeping` helper method, as it would mix `wd` and `src_path` when removing a path that was assigned to more than one `wd`. The items on the `wd` to/from `src_path` mappings are still being removed, but consistently and inlined;\r\n- Add a test with a [fast] directory creation and deletion cycle. On Linux, after fixing the related code, the `DirDeletedEvent` was emitted twice as both the `IN_DELETE|IS_DIR` event and the `IN_DELETE_SELF` event were triggering a watchdog event, that was fixed by removing the latter event;\r\n- Add a test for the inotify emitter in a corner case, where a directory is created and deleted twice before emitting the first `IN_DELETE_SELF`, mocking the Inotify API for that. This test doesn't depend on randomness/speed). The mock/monkeypatch required another test module to properly stop the emitter.\r\n\r\nThe `IN_DELETE_SELF` is a directory-only event, so this inotify event doesn't have an `IS_DIR` flag. The former code that evaluated `cls = DirDeletedEvent if event.is_directory else FileDeletedEvent` on such an event is an evidence that it wasn't being tested.","created_at":"2016-09-24T19:46:07Z","updated_at":"2016-09-24T19:46:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/gorakhargosh/watchdog/pulls/375/commits","review_comments_url":"https://api.github.com/repos/gorakhargosh/watchdog/pulls/375/comments","review_comment_url":"https://api.github.com/repos/gorakhargosh/watchdog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gorakhargosh/watchdog/issues/375/comments","statuses_url":"https://api.github.com/repos/gorakhargosh/watchdog/statuses/ca335db335694c6987830c2401fcb9e24dc3bebd","head":{"label":"danilobellini:inotify","ref":"inotify","sha":"ca335db335694c6987830c2401fcb9e24dc3bebd","user":{"login":"danilobellini","id":2096474,"avatar_url":"https://avatars.githubusercontent.com/u/2096474?v=3","gravatar_id":"","url":"https://api.github.com/users/danilobellini","html_url":"https://github.com/danilobellini","followers_url":"https://api.github.com/users/danilobellini/followers","following_url":"https://api.github.com/users/danilobellini/following{/other_user}","gists_url":"https://api.github.com/users/danilobellini/gists{/gist_id}","starred_url":"https://api.github.com/users/danilobellini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danilobellini/subscriptions","organizations_url":"https://api.github.com/users/danilobellini/orgs","repos_url":"https://api.github.com/users/danilobellini/repos","events_url":"https://api.github.com/users/danilobellini/events{/privacy}","received_events_url":"https://api.github.com/users/danilobellini/received_events","type":"User","site_admin":false},"repo":{"id":65427852,"name":"watchdog","full_name":"danilobellini/watchdog","owner":{"login":"danilobellini","id":2096474,"avatar_url":"https://avatars.githubusercontent.com/u/2096474?v=3","gravatar_id":"","url":"https://api.github.com/users/danilobellini","html_url":"https://github.com/danilobellini","followers_url":"https://api.github.com/users/danilobellini/followers","following_url":"https://api.github.com/users/danilobellini/following{/other_user}","gists_url":"https://api.github.com/users/danilobellini/gists{/gist_id}","starred_url":"https://api.github.com/users/danilobellini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danilobellini/subscriptions","organizations_url":"https://api.github.com/users/danilobellini/orgs","repos_url":"https://api.github.com/users/danilobellini/repos","events_url":"https://api.github.com/users/danilobellini/events{/privacy}","received_events_url":"https://api.github.com/users/danilobellini/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danilobellini/watchdog","description":"Python library and shell utilities to monitor filesystem events.","fork":true,"url":"https://api.github.com/repos/danilobellini/watchdog","forks_url":"https://api.github.com/repos/danilobellini/watchdog/forks","keys_url":"https://api.github.com/repos/danilobellini/watchdog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danilobellini/watchdog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danilobellini/watchdog/teams","hooks_url":"https://api.github.com/repos/danilobellini/watchdog/hooks","issue_events_url":"https://api.github.com/repos/danilobellini/watchdog/issues/events{/number}","events_url":"https://api.github.com/repos/danilobellini/watchdog/events","assignees_url":"https://api.github.com/repos/danilobellini/watchdog/assignees{/user}","branches_url":"https://api.github.com/repos/danilobellini/watchdog/branches{/branch}","tags_url":"https://api.github.com/repos/danilobellini/watchdog/tags","blobs_url":"https://api.github.com/repos/danilobellini/watchdog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danilobellini/watchdog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danilobellini/watchdog/git/refs{/sha}","trees_url":"https://api.github.com/repos/danilobellini/watchdog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danilobellini/watchdog/statuses/{sha}","languages_url":"https://api.github.com/repos/danilobellini/watchdog/languages","stargazers_url":"https://api.github.com/repos/danilobellini/watchdog/stargazers","contributors_url":"https://api.github.com/repos/danilobellini/watchdog/contributors","subscribers_url":"https://api.github.com/repos/danilobellini/watchdog/subscribers","subscription_url":"https://api.github.com/repos/danilobellini/watchdog/subscription","commits_url":"https://api.github.com/repos/danilobellini/watchdog/commits{/sha}","git_commits_url":"https://api.github.com/repos/danilobellini/watchdog/git/commits{/sha}","comments_url":"https://api.github.com/repos/danilobellini/watchdog/comments{/number}","issue_comment_url":"https://api.github.com/repos/danilobellini/watchdog/issues/comments{/number}","contents_url":"https://api.github.com/repos/danilobellini/watchdog/contents/{+path}","compare_url":"https://api.github.com/repos/danilobellini/watchdog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danilobellini/watchdog/merges","archive_url":"https://api.github.com/repos/danilobellini/watchdog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danilobellini/watchdog/downloads","issues_url":"https://api.github.com/repos/danilobellini/watchdog/issues{/number}","pulls_url":"https://api.github.com/repos/danilobellini/watchdog/pulls{/number}","milestones_url":"https://api.github.com/repos/danilobellini/watchdog/milestones{/number}","notifications_url":"https://api.github.com/repos/danilobellini/watchdog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danilobellini/watchdog/labels{/name}","releases_url":"https://api.github.com/repos/danilobellini/watchdog/releases{/id}","deployments_url":"https://api.github.com/repos/danilobellini/watchdog/deployments","created_at":"2016-08-11T01:20:56Z","updated_at":"2016-08-11T01:20:57Z","pushed_at":"2016-09-24T19:09:10Z","git_url":"git://github.com/danilobellini/watchdog.git","ssh_url":"git@github.com:danilobellini/watchdog.git","clone_url":"https://github.com/danilobellini/watchdog.git","svn_url":"https://github.com/danilobellini/watchdog","homepage":"http://packages.python.org/watchdog/","size":1346,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gorakhargosh:master","ref":"master","sha":"f1d32fd0e02cfbc727ae2b15f6eb9937959c3541","user":{"login":"gorakhargosh","id":364101,"avatar_url":"https://avatars.githubusercontent.com/u/364101?v=3","gravatar_id":"","url":"https://api.github.com/users/gorakhargosh","html_url":"https://github.com/gorakhargosh","followers_url":"https://api.github.com/users/gorakhargosh/followers","following_url":"https://api.github.com/users/gorakhargosh/following{/other_user}","gists_url":"https://api.github.com/users/gorakhargosh/gists{/gist_id}","starred_url":"https://api.github.com/users/gorakhargosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gorakhargosh/subscriptions","organizations_url":"https://api.github.com/users/gorakhargosh/orgs","repos_url":"https://api.github.com/users/gorakhargosh/repos","events_url":"https://api.github.com/users/gorakhargosh/events{/privacy}","received_events_url":"https://api.github.com/users/gorakhargosh/received_events","type":"User","site_admin":false},"repo":{"id":1017451,"name":"watchdog","full_name":"gorakhargosh/watchdog","owner":{"login":"gorakhargosh","id":364101,"avatar_url":"https://avatars.githubusercontent.com/u/364101?v=3","gravatar_id":"","url":"https://api.github.com/users/gorakhargosh","html_url":"https://github.com/gorakhargosh","followers_url":"https://api.github.com/users/gorakhargosh/followers","following_url":"https://api.github.com/users/gorakhargosh/following{/other_user}","gists_url":"https://api.github.com/users/gorakhargosh/gists{/gist_id}","starred_url":"https://api.github.com/users/gorakhargosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gorakhargosh/subscriptions","organizations_url":"https://api.github.com/users/gorakhargosh/orgs","repos_url":"https://api.github.com/users/gorakhargosh/repos","events_url":"https://api.github.com/users/gorakhargosh/events{/privacy}","received_events_url":"https://api.github.com/users/gorakhargosh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gorakhargosh/watchdog","description":"Python library and shell utilities to monitor filesystem events.","fork":false,"url":"https://api.github.com/repos/gorakhargosh/watchdog","forks_url":"https://api.github.com/repos/gorakhargosh/watchdog/forks","keys_url":"https://api.github.com/repos/gorakhargosh/watchdog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gorakhargosh/watchdog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gorakhargosh/watchdog/teams","hooks_url":"https://api.github.com/repos/gorakhargosh/watchdog/hooks","issue_events_url":"https://api.github.com/repos/gorakhargosh/watchdog/issues/events{/number}","events_url":"https://api.github.com/repos/gorakhargosh/watchdog/events","assignees_url":"https://api.github.com/repos/gorakhargosh/watchdog/assignees{/user}","branches_url":"https://api.github.com/repos/gorakhargosh/watchdog/branches{/branch}","tags_url":"https://api.github.com/repos/gorakhargosh/watchdog/tags","blobs_url":"https://api.github.com/repos/gorakhargosh/watchdog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gorakhargosh/watchdog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gorakhargosh/watchdog/git/refs{/sha}","trees_url":"https://api.github.com/repos/gorakhargosh/watchdog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gorakhargosh/watchdog/statuses/{sha}","languages_url":"https://api.github.com/repos/gorakhargosh/watchdog/languages","stargazers_url":"https://api.github.com/repos/gorakhargosh/watchdog/stargazers","contributors_url":"https://api.github.com/repos/gorakhargosh/watchdog/contributors","subscribers_url":"https://api.github.com/repos/gorakhargosh/watchdog/subscribers","subscription_url":"https://api.github.com/repos/gorakhargosh/watchdog/subscription","commits_url":"https://api.github.com/repos/gorakhargosh/watchdog/commits{/sha}","git_commits_url":"https://api.github.com/repos/gorakhargosh/watchdog/git/commits{/sha}","comments_url":"https://api.github.com/repos/gorakhargosh/watchdog/comments{/number}","issue_comment_url":"https://api.github.com/repos/gorakhargosh/watchdog/issues/comments{/number}","contents_url":"https://api.github.com/repos/gorakhargosh/watchdog/contents/{+path}","compare_url":"https://api.github.com/repos/gorakhargosh/watchdog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gorakhargosh/watchdog/merges","archive_url":"https://api.github.com/repos/gorakhargosh/watchdog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gorakhargosh/watchdog/downloads","issues_url":"https://api.github.com/repos/gorakhargosh/watchdog/issues{/number}","pulls_url":"https://api.github.com/repos/gorakhargosh/watchdog/pulls{/number}","milestones_url":"https://api.github.com/repos/gorakhargosh/watchdog/milestones{/number}","notifications_url":"https://api.github.com/repos/gorakhargosh/watchdog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gorakhargosh/watchdog/labels{/name}","releases_url":"https://api.github.com/repos/gorakhargosh/watchdog/releases{/id}","deployments_url":"https://api.github.com/repos/gorakhargosh/watchdog/deployments","created_at":"2010-10-23T12:00:17Z","updated_at":"2016-09-24T17:04:20Z","pushed_at":"2016-09-24T19:06:17Z","git_url":"git://github.com/gorakhargosh/watchdog.git","ssh_url":"git@github.com:gorakhargosh/watchdog.git","clone_url":"https://github.com/gorakhargosh/watchdog.git","svn_url":"https://github.com/gorakhargosh/watchdog","homepage":"http://packages.python.org/watchdog/","size":2179,"stargazers_count":2200,"watchers_count":2200,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":291,"mirror_url":null,"open_issues_count":112,"forks":291,"open_issues":112,"watchers":2200,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gorakhargosh/watchdog/pulls/375"},"html":{"href":"https://github.com/gorakhargosh/watchdog/pull/375"},"issue":{"href":"https://api.github.com/repos/gorakhargosh/watchdog/issues/375"},"comments":{"href":"https://api.github.com/repos/gorakhargosh/watchdog/issues/375/comments"},"review_comments":{"href":"https://api.github.com/repos/gorakhargosh/watchdog/pulls/375/comments"},"review_comment":{"href":"https://api.github.com/repos/gorakhargosh/watchdog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gorakhargosh/watchdog/pulls/375/commits"},"statuses":{"href":"https://api.github.com/repos/gorakhargosh/watchdog/statuses/ca335db335694c6987830c2401fcb9e24dc3bebd"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":4,"additions":151,"deletions":10,"changed_files":4}}
{"actor":{"display_login":"danilobellini"}}