{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/13590","labels_url":"https://api.github.com/repos/docker/docker/issues/13590/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/13590/comments","events_url":"https://api.github.com/repos/docker/docker/issues/13590/events","html_url":"https://github.com/docker/docker/pull/13590","id":82448839,"number":13590,"title":"Add the parent directory to changes set if new files are generated","user":{"login":"mountkin","id":1496652,"avatar_url":"https://avatars.githubusercontent.com/u/1496652?v=3","gravatar_id":"","url":"https://api.github.com/users/mountkin","html_url":"https://github.com/mountkin","followers_url":"https://api.github.com/users/mountkin/followers","following_url":"https://api.github.com/users/mountkin/following{/other_user}","gists_url":"https://api.github.com/users/mountkin/gists{/gist_id}","starred_url":"https://api.github.com/users/mountkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mountkin/subscriptions","organizations_url":"https://api.github.com/users/mountkin/orgs","repos_url":"https://api.github.com/users/mountkin/repos","events_url":"https://api.github.com/users/mountkin/events{/privacy}","received_events_url":"https://api.github.com/users/mountkin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/status/2-needs-code-review","name":"status/2-needs-code-review","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2015-05-29T14:22:18Z","updated_at":"2015-06-10T16:16:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/13590","html_url":"https://github.com/docker/docker/pull/13590","diff_url":"https://github.com/docker/docker/pull/13590.diff","patch_url":"https://github.com/docker/docker/pull/13590.patch"},"body":"The \"TestChangesWithChanges\" case randomlly fails on my development VM with the following errors:\r\n```\r\n--- FAIL: TestChangesWithChanges (0.00s)\r\n        changes_test.go:201: no change for expected change C /dir1/subfolder != A /dir1/subfolder/newFile\r\n```\r\nThe test details can be found here: http://pastebin.com/bYupfSr4\r\n\r\nIf I apply the following patch to changes_test.go, the test passes.\r\n\r\n```diff\r\ndiff --git a/pkg/archive/changes_test.go b/pkg/archive/changes_test.go\r\nindex 290b2dd..ba1aca0 100644\r\n--- a/pkg/archive/changes_test.go\r\n+++ b/pkg/archive/changes_test.go\r\n@@ -156,6 +156,7 @@ func TestChangesWithChanges(t *testing.T) {\r\n        }\r\n        defer os.RemoveAll(layer)\r\n        createSampleDir(t, layer)\r\n+       time.Sleep(5 * time.Millisecond)\r\n        os.MkdirAll(path.Join(layer, \"dir1/subfolder\"), 0740)\r\n\r\n        // Let's modify modtime for dir1 to be sure it's the same for the two layer (to not having false positive)\r\n```\r\n\r\nIt seems that if a file is created immediately after the directory is created, the `archive.Changes` function could't recognize that the parent directory of the new file is modified.\r\n\r\nPerhaps the problem may reproduce on machines with low time precision?\r\nI had successfully reproduced the failure on my development VM as well as a VM on DigitalOcean.\r\n\r\nSigned-off-by: Shijiang Wei <mountkin@gmail.com>"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/110818746","html_url":"https://github.com/docker/docker/pull/13590#issuecomment-110818746","issue_url":"https://api.github.com/repos/docker/docker/issues/13590","id":110818746,"user":{"login":"duglin","id":1944671,"avatar_url":"https://avatars.githubusercontent.com/u/1944671?v=3","gravatar_id":"","url":"https://api.github.com/users/duglin","html_url":"https://github.com/duglin","followers_url":"https://api.github.com/users/duglin/followers","following_url":"https://api.github.com/users/duglin/following{/other_user}","gists_url":"https://api.github.com/users/duglin/gists{/gist_id}","starred_url":"https://api.github.com/users/duglin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duglin/subscriptions","organizations_url":"https://api.github.com/users/duglin/orgs","repos_url":"https://api.github.com/users/duglin/repos","events_url":"https://api.github.com/users/duglin/events{/privacy}","received_events_url":"https://api.github.com/users/duglin/received_events","type":"User","site_admin":false},"created_at":"2015-06-10T16:16:52Z","updated_at":"2015-06-10T16:16:52Z","body":"@mountkin no worries, as long as the correct code gets in, that's all that matters.\r\n\r\n@vbatts @vdemeester you guys ok with the changes?  Please check the testcases too since we did modify those a little.  I want to make sure we don't incorrectly add, or remove, from the list of changes people are used to seeing."}}