{"action":"created","comment":{"url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/pulls/comments/177270769","pull_request_review_id":107111933,"id":177270769,"diff_hunk":"@@ -156,31 +220,57 @@ def test_bob_creates_alice_deletes_alice_restores(magic_folder):\n         f.write(\"alice re-wrote this again, because reasons\")\n \n \n-# this sometimes fails on Travis\n-@pytest.mark.xfail\n def test_bob_conflicts_with_alice_fresh(magic_folder):\n     # both alice and bob make a file at \"the same time\".\n     alice_dir, bob_dir = magic_folder\n \n-    # really, we fudge this a little: in reality, either alice or bob\n-    # \"wins\" by uploading to the DMD first. So we make sure bob wins\n-    # this one by giving him a massive head start\n+    # either alice or bob will \"win\" by uploading to the DMD first.\n     with open(join(bob_dir, 'alpha'), 'w') as f:\n         f.write(\"this is bob's alpha\\n\")\n-    time.sleep(1.0)\n     with open(join(alice_dir, 'alpha'), 'w') as f:\n         f.write(\"this is alice's alpha\\n\")\n \n-    # since bob uploaded first, alice should see a backup\n-    util.await_file_contents(join(alice_dir, 'alpha'), \"this is bob's alpha\\n\")\n-    util.await_file_contents(join(alice_dir, 'alpha.backup'), \"this is alice's alpha\\n\")\n+    # there should be a conflict, but we don't know who will win the\n+    # race\n+    acceptable = [\n+        join(bob_dir, 'alpha.conflict'),\n+        join(alice_dir, 'alpha.conflict'),\n+    ]\n+    found = None\n+    start_time = time.time()\n+    while not found and time.time() - start_time < 15.0:\n+        print(\"  waiting for conflict\")\n+        print(\"bob\")\n+        print(listdir(bob_dir))\n+        print(\"alice\")\n+        print(listdir(alice_dir))\n+        for path in acceptable:\n+            if exists(path):\n+                print(\"FOUND {}\".format(path))\n+                found = path\n+                break\n+        time.sleep(1)\n \n-    util.await_file_contents(join(bob_dir, 'alpha'), \"this is alice's alpha\\n\")\n-    util.await_file_contents(join(bob_dir, 'alpha.backup'), \"this is bob's alpha\\n\")\n+    assert found, \"should have gotten a conflict\"\n+    if exists(acceptable[0]):  # bob got the conflict, so alice won the race\n+        assert open(join(bob_dir, 'alpha'), 'r').read() == \"this is bob's alpha\\n\"\n+        assert open(join(bob_dir, 'alpha.conflict'), 'r').read() == \"this is alice's alpha\\n\"\n+        assert open(join(alice_dir, 'alpha'), 'r').read() == \"this is alice's alpha\\n\"\n+        if exists(join(alice_dir, 'alpha.conflict')):\n+            assert open(join(alice_dir, 'alpha.conflict'), 'r').read() == \"this is bob's alpha\\n\"\n+        # hmm, so Alice is getting a conflict *too*? Is that okay?\n+        # assert not exists(join(alice_dir, 'alpha.conflict'))\n+    else:                      # alice got the conflict, so bob won the race\n+        assert exists(acceptable[1])\n+        assert open(join(alice_dir, 'alpha'), 'r').read() == \"this is alice's alpha\\n\"\n+        assert open(join(alice_dir, 'alpha.conflict'), 'r').read() == \"this is bob's alpha\\n\"\n+        assert open(join(bob_dir, 'alpha'), 'r').read() == \"this is bob's alpha\\n\"\n+        if exists(join(bob_dir, 'alpha.conflict')):\n+            assert open(join(bob_dir, 'alpha.conflict'), 'r').read() == \"this is alice's alpha\\n\"\n+        # hmm, so Bob is getting a conflict *too*? Is that okay?\n+        # assert not exists(join(bob_dir, 'alpha.conflict'))","path":"integration/test_magic_folder.py","position":134,"original_position":134,"commit_id":"543588fc672e1276f6083a36f4b4452d8b44f9e9","original_commit_id":"543588fc672e1276f6083a36f4b4452d8b44f9e9","user":{"login":"exarkun","id":254565,"avatar_url":"https://avatars1.githubusercontent.com/u/254565?v=4","gravatar_id":"","url":"https://api.github.com/users/exarkun","html_url":"https://github.com/exarkun","followers_url":"https://api.github.com/users/exarkun/followers","following_url":"https://api.github.com/users/exarkun/following{/other_user}","gists_url":"https://api.github.com/users/exarkun/gists{/gist_id}","starred_url":"https://api.github.com/users/exarkun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exarkun/subscriptions","organizations_url":"https://api.github.com/users/exarkun/orgs","repos_url":"https://api.github.com/users/exarkun/repos","events_url":"https://api.github.com/users/exarkun/events{/privacy}","received_events_url":"https://api.github.com/users/exarkun/received_events","type":"User","site_admin":false},"body":"Maybe these two branches would be better off setting up some data and then allowing all of the assertions to follow in one unified codepath.\r\n\r\nAlso.  It does *not* seem okay that both sides get a conflict.","created_at":"2018-03-27T00:00:50Z","updated_at":"2018-03-27T00:09:58Z","html_url":"https://github.com/tahoe-lafs/tahoe-lafs/pull/475#discussion_r177270769","pull_request_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/pulls/475","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/pulls/comments/177270769"},"html":{"href":"https://github.com/tahoe-lafs/tahoe-lafs/pull/475#discussion_r177270769"},"pull_request":{"href":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/pulls/475"}}},"pull_request":{"url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/pulls/475","id":177573133,"html_url":"https://github.com/tahoe-lafs/tahoe-lafs/pull/475","diff_url":"https://github.com/tahoe-lafs/tahoe-lafs/pull/475.diff","patch_url":"https://github.com/tahoe-lafs/tahoe-lafs/pull/475.patch","issue_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/issues/475","number":475,"state":"open","locked":false,"title":"2909.backup behavior.0","user":{"login":"meejah","id":145599,"avatar_url":"https://avatars3.githubusercontent.com/u/145599?v=4","gravatar_id":"","url":"https://api.github.com/users/meejah","html_url":"https://github.com/meejah","followers_url":"https://api.github.com/users/meejah/followers","following_url":"https://api.github.com/users/meejah/following{/other_user}","gists_url":"https://api.github.com/users/meejah/gists{/gist_id}","starred_url":"https://api.github.com/users/meejah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meejah/subscriptions","organizations_url":"https://api.github.com/users/meejah/orgs","repos_url":"https://api.github.com/users/meejah/repos","events_url":"https://api.github.com/users/meejah/events{/privacy}","received_events_url":"https://api.github.com/users/meejah/received_events","type":"User","site_admin":false},"body":"See #2909, I believe this fixes the behavior (we should now only see .backup files when another party deletes a file).","created_at":"2018-03-26T21:28:55Z","updated_at":"2018-03-27T00:09:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c22a5d07bb33011c2ef6983176572a8c0e36a396","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/pulls/475/commits","review_comments_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/pulls/475/comments","review_comment_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/issues/475/comments","statuses_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/statuses/543588fc672e1276f6083a36f4b4452d8b44f9e9","head":{"label":"meejah:2909.backup-behavior.0","ref":"2909.backup-behavior.0","sha":"543588fc672e1276f6083a36f4b4452d8b44f9e9","user":{"login":"meejah","id":145599,"avatar_url":"https://avatars3.githubusercontent.com/u/145599?v=4","gravatar_id":"","url":"https://api.github.com/users/meejah","html_url":"https://github.com/meejah","followers_url":"https://api.github.com/users/meejah/followers","following_url":"https://api.github.com/users/meejah/following{/other_user}","gists_url":"https://api.github.com/users/meejah/gists{/gist_id}","starred_url":"https://api.github.com/users/meejah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meejah/subscriptions","organizations_url":"https://api.github.com/users/meejah/orgs","repos_url":"https://api.github.com/users/meejah/repos","events_url":"https://api.github.com/users/meejah/events{/privacy}","received_events_url":"https://api.github.com/users/meejah/received_events","type":"User","site_admin":false},"repo":{"id":42634043,"name":"tahoe-lafs","full_name":"meejah/tahoe-lafs","owner":{"login":"meejah","id":145599,"avatar_url":"https://avatars3.githubusercontent.com/u/145599?v=4","gravatar_id":"","url":"https://api.github.com/users/meejah","html_url":"https://github.com/meejah","followers_url":"https://api.github.com/users/meejah/followers","following_url":"https://api.github.com/users/meejah/following{/other_user}","gists_url":"https://api.github.com/users/meejah/gists{/gist_id}","starred_url":"https://api.github.com/users/meejah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meejah/subscriptions","organizations_url":"https://api.github.com/users/meejah/orgs","repos_url":"https://api.github.com/users/meejah/repos","events_url":"https://api.github.com/users/meejah/events{/privacy}","received_events_url":"https://api.github.com/users/meejah/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/meejah/tahoe-lafs","description":"The Tahoe-LAFS decentralized secure filesystem.","fork":true,"url":"https://api.github.com/repos/meejah/tahoe-lafs","forks_url":"https://api.github.com/repos/meejah/tahoe-lafs/forks","keys_url":"https://api.github.com/repos/meejah/tahoe-lafs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meejah/tahoe-lafs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meejah/tahoe-lafs/teams","hooks_url":"https://api.github.com/repos/meejah/tahoe-lafs/hooks","issue_events_url":"https://api.github.com/repos/meejah/tahoe-lafs/issues/events{/number}","events_url":"https://api.github.com/repos/meejah/tahoe-lafs/events","assignees_url":"https://api.github.com/repos/meejah/tahoe-lafs/assignees{/user}","branches_url":"https://api.github.com/repos/meejah/tahoe-lafs/branches{/branch}","tags_url":"https://api.github.com/repos/meejah/tahoe-lafs/tags","blobs_url":"https://api.github.com/repos/meejah/tahoe-lafs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meejah/tahoe-lafs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meejah/tahoe-lafs/git/refs{/sha}","trees_url":"https://api.github.com/repos/meejah/tahoe-lafs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meejah/tahoe-lafs/statuses/{sha}","languages_url":"https://api.github.com/repos/meejah/tahoe-lafs/languages","stargazers_url":"https://api.github.com/repos/meejah/tahoe-lafs/stargazers","contributors_url":"https://api.github.com/repos/meejah/tahoe-lafs/contributors","subscribers_url":"https://api.github.com/repos/meejah/tahoe-lafs/subscribers","subscription_url":"https://api.github.com/repos/meejah/tahoe-lafs/subscription","commits_url":"https://api.github.com/repos/meejah/tahoe-lafs/commits{/sha}","git_commits_url":"https://api.github.com/repos/meejah/tahoe-lafs/git/commits{/sha}","comments_url":"https://api.github.com/repos/meejah/tahoe-lafs/comments{/number}","issue_comment_url":"https://api.github.com/repos/meejah/tahoe-lafs/issues/comments{/number}","contents_url":"https://api.github.com/repos/meejah/tahoe-lafs/contents/{+path}","compare_url":"https://api.github.com/repos/meejah/tahoe-lafs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meejah/tahoe-lafs/merges","archive_url":"https://api.github.com/repos/meejah/tahoe-lafs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meejah/tahoe-lafs/downloads","issues_url":"https://api.github.com/repos/meejah/tahoe-lafs/issues{/number}","pulls_url":"https://api.github.com/repos/meejah/tahoe-lafs/pulls{/number}","milestones_url":"https://api.github.com/repos/meejah/tahoe-lafs/milestones{/number}","notifications_url":"https://api.github.com/repos/meejah/tahoe-lafs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meejah/tahoe-lafs/labels{/name}","releases_url":"https://api.github.com/repos/meejah/tahoe-lafs/releases{/id}","deployments_url":"https://api.github.com/repos/meejah/tahoe-lafs/deployments","created_at":"2015-09-17T04:05:14Z","updated_at":"2016-01-19T19:35:02Z","pushed_at":"2018-03-26T21:28:16Z","git_url":"git://github.com/meejah/tahoe-lafs.git","ssh_url":"git@github.com:meejah/tahoe-lafs.git","clone_url":"https://github.com/meejah/tahoe-lafs.git","svn_url":"https://github.com/meejah/tahoe-lafs","homepage":"https://tahoe-lafs.org/","size":68015,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tahoe-lafs:master","ref":"master","sha":"38da8f471cc3c79d505d39cefcbdebc532812303","user":{"login":"tahoe-lafs","id":1156454,"avatar_url":"https://avatars1.githubusercontent.com/u/1156454?v=4","gravatar_id":"","url":"https://api.github.com/users/tahoe-lafs","html_url":"https://github.com/tahoe-lafs","followers_url":"https://api.github.com/users/tahoe-lafs/followers","following_url":"https://api.github.com/users/tahoe-lafs/following{/other_user}","gists_url":"https://api.github.com/users/tahoe-lafs/gists{/gist_id}","starred_url":"https://api.github.com/users/tahoe-lafs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tahoe-lafs/subscriptions","organizations_url":"https://api.github.com/users/tahoe-lafs/orgs","repos_url":"https://api.github.com/users/tahoe-lafs/repos","events_url":"https://api.github.com/users/tahoe-lafs/events{/privacy}","received_events_url":"https://api.github.com/users/tahoe-lafs/received_events","type":"Organization","site_admin":false},"repo":{"id":3007569,"name":"tahoe-lafs","full_name":"tahoe-lafs/tahoe-lafs","owner":{"login":"tahoe-lafs","id":1156454,"avatar_url":"https://avatars1.githubusercontent.com/u/1156454?v=4","gravatar_id":"","url":"https://api.github.com/users/tahoe-lafs","html_url":"https://github.com/tahoe-lafs","followers_url":"https://api.github.com/users/tahoe-lafs/followers","following_url":"https://api.github.com/users/tahoe-lafs/following{/other_user}","gists_url":"https://api.github.com/users/tahoe-lafs/gists{/gist_id}","starred_url":"https://api.github.com/users/tahoe-lafs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tahoe-lafs/subscriptions","organizations_url":"https://api.github.com/users/tahoe-lafs/orgs","repos_url":"https://api.github.com/users/tahoe-lafs/repos","events_url":"https://api.github.com/users/tahoe-lafs/events{/privacy}","received_events_url":"https://api.github.com/users/tahoe-lafs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tahoe-lafs/tahoe-lafs","description":"The Tahoe-LAFS decentralized secure filesystem.","fork":false,"url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs","forks_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/forks","keys_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/teams","hooks_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/hooks","issue_events_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/issues/events{/number}","events_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/events","assignees_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/assignees{/user}","branches_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/branches{/branch}","tags_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/tags","blobs_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/git/refs{/sha}","trees_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/statuses/{sha}","languages_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/languages","stargazers_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/stargazers","contributors_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/contributors","subscribers_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/subscribers","subscription_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/subscription","commits_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/commits{/sha}","git_commits_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/git/commits{/sha}","comments_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/comments{/number}","issue_comment_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/issues/comments{/number}","contents_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/contents/{+path}","compare_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/merges","archive_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/downloads","issues_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/issues{/number}","pulls_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/pulls{/number}","milestones_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/milestones{/number}","notifications_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/labels{/name}","releases_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/releases{/id}","deployments_url":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/deployments","created_at":"2011-12-18T19:33:55Z","updated_at":"2018-03-25T17:51:18Z","pushed_at":"2018-03-26T21:28:56Z","git_url":"git://github.com/tahoe-lafs/tahoe-lafs.git","ssh_url":"git@github.com:tahoe-lafs/tahoe-lafs.git","clone_url":"https://github.com/tahoe-lafs/tahoe-lafs.git","svn_url":"https://github.com/tahoe-lafs/tahoe-lafs","homepage":"https://tahoe-lafs.org/","size":67976,"stargazers_count":743,"watchers_count":743,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":183,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":183,"open_issues":20,"watchers":743,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/pulls/475"},"html":{"href":"https://github.com/tahoe-lafs/tahoe-lafs/pull/475"},"issue":{"href":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/issues/475"},"comments":{"href":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/issues/475/comments"},"review_comments":{"href":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/pulls/475/comments"},"review_comment":{"href":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/pulls/475/commits"},"statuses":{"href":"https://api.github.com/repos/tahoe-lafs/tahoe-lafs/statuses/543588fc672e1276f6083a36f4b4452d8b44f9e9"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"exarkun"}}