{"action":"created","issue":{"url":"https://api.github.com/repos/libuv/libuv/issues/480","labels_url":"https://api.github.com/repos/libuv/libuv/issues/480/labels{/name}","comments_url":"https://api.github.com/repos/libuv/libuv/issues/480/comments","events_url":"https://api.github.com/repos/libuv/libuv/issues/480/events","html_url":"https://github.com/libuv/libuv/pull/480","id":101112595,"number":480,"title":"tests: refactored fs watch_dir tests for stability","user":{"login":"whitlockjc","id":98899,"avatar_url":"https://avatars.githubusercontent.com/u/98899?v=3","gravatar_id":"","url":"https://api.github.com/users/whitlockjc","html_url":"https://github.com/whitlockjc","followers_url":"https://api.github.com/users/whitlockjc/followers","following_url":"https://api.github.com/users/whitlockjc/following{/other_user}","gists_url":"https://api.github.com/users/whitlockjc/gists{/gist_id}","starred_url":"https://api.github.com/users/whitlockjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitlockjc/subscriptions","organizations_url":"https://api.github.com/users/whitlockjc/orgs","repos_url":"https://api.github.com/users/whitlockjc/repos","events_url":"https://api.github.com/users/whitlockjc/events{/privacy}","received_events_url":"https://api.github.com/users/whitlockjc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-08-14T22:09:37Z","updated_at":"2015-08-18T15:33:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/libuv/libuv/pulls/480","html_url":"https://github.com/libuv/libuv/pull/480","diff_url":"https://github.com/libuv/libuv/pull/480.diff","patch_url":"https://github.com/libuv/libuv/pull/480.patch"},"body":"`fs_event_watch_dir` and `fs_event_watch_dir_recursive` could fail randomly\r\ndue to the way in which the tests were written.  Originally timers were\r\nused to create, remove and recreate the test files but this could lead\r\nto a race condition if the timeout used to delete the test files ran\r\nbefore all file creation fs events were handled.  On top of that, the\r\nfile removal timer scheduled another timer to recreate the test files\r\nand that timer's timeout could also lead to the same condition.\r\n\r\nThe refactoring removed timers for the removal/recreation of the test\r\nfiles and instead the fs event callback was updated to have the\r\nnecessary logic to drive the test file removal.  We no longer recreate\r\nthe test files since it appears to be unnecessary.\r\n\r\nWith the current PR, I can run 1000 tests for `fs_event_watch_dir` and\r\n`fs_event_watch_dir_recursive` without a single failure, where prior to this\r\nPR they would fail 14/100 on average.\r\n\r\nFixes #30"},"comment":{"url":"https://api.github.com/repos/libuv/libuv/issues/comments/132251855","html_url":"https://github.com/libuv/libuv/pull/480#issuecomment-132251855","issue_url":"https://api.github.com/repos/libuv/libuv/issues/480","id":132251855,"user":{"login":"whitlockjc","id":98899,"avatar_url":"https://avatars.githubusercontent.com/u/98899?v=3","gravatar_id":"","url":"https://api.github.com/users/whitlockjc","html_url":"https://github.com/whitlockjc","followers_url":"https://api.github.com/users/whitlockjc/followers","following_url":"https://api.github.com/users/whitlockjc/following{/other_user}","gists_url":"https://api.github.com/users/whitlockjc/gists{/gist_id}","starred_url":"https://api.github.com/users/whitlockjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitlockjc/subscriptions","organizations_url":"https://api.github.com/users/whitlockjc/orgs","repos_url":"https://api.github.com/users/whitlockjc/repos","events_url":"https://api.github.com/users/whitlockjc/events{/privacy}","received_events_url":"https://api.github.com/users/whitlockjc/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T15:33:35Z","updated_at":"2015-08-18T15:33:35Z","body":"I think we're back in the state we were prior to this PR.  FreeBSD and SmartOS are failing as they were before and I think it might be a bigger issue.\r\n\r\n@saghul Can you kick off a new CI build to make sure CentOS7 is passing again?"}}