{"action":"created","comment":{"url":"https://api.github.com/repos/coreos/etcd/pulls/comments/79589031","id":79589031,"diff_hunk":"@@ -213,6 +213,39 @@ func TestCut(t *testing.T) {\n \t}\n }\n \n+func TestSaveWithCut(t *testing.T) {\n+\tp, err := ioutil.TempDir(os.TempDir(), \"waltest\")\n+\tif err != nil {\n+\t\tt.Fatal(err)\n+\t}\n+\tdefer os.RemoveAll(p)\n+\n+\tw, err := Create(p, []byte(\"metadata\"))\n+\tif err != nil {\n+\t\tt.Fatal(err)\n+\t}\n+\tdefer w.Close()\n+\n+\tstate := raftpb.HardState{Term: 1}\n+\tif err = w.Save(state, nil); err != nil {\n+\t\tt.Fatal(err)\n+\t}\n+\tbigData := make([]byte, 500)\n+\ttotalSize := 0\n+\t// set a lower value for SegmentSizeBytes, else the test takes too long to complete\n+\trestoreLater := SegmentSizeBytes\n+\tSegmentSizeBytes = 2 * 1024\n+\tvar index uint64 = 0\n+\tfor ; totalSize < int(SegmentSizeBytes); index++ {\n+\t\tents := []raftpb.Entry{{Index: index, Term: 1, Data: bigData}}\n+\t\tif err = w.Save(state, ents); err != nil {\n+\t\t\tt.Fatal(err)\n+\t\t}\n+\t\ttotalSize += 500\n+\t}\n+\tSegmentSizeBytes = restoreLater","path":"wal/wal_test.go","position":34,"original_position":34,"commit_id":"7c2039cc0983f432b8bcf41bf2fb562b0ce685c7","original_commit_id":"1493addf098d860b15f2cfcfc766ad8af70bc790","user":{"login":"vimalk78","id":3284044,"avatar_url":"https://avatars.githubusercontent.com/u/3284044?v=3","gravatar_id":"","url":"https://api.github.com/users/vimalk78","html_url":"https://github.com/vimalk78","followers_url":"https://api.github.com/users/vimalk78/followers","following_url":"https://api.github.com/users/vimalk78/following{/other_user}","gists_url":"https://api.github.com/users/vimalk78/gists{/gist_id}","starred_url":"https://api.github.com/users/vimalk78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vimalk78/subscriptions","organizations_url":"https://api.github.com/users/vimalk78/orgs","repos_url":"https://api.github.com/users/vimalk78/repos","events_url":"https://api.github.com/users/vimalk78/events{/privacy}","received_events_url":"https://api.github.com/users/vimalk78/received_events","type":"User","site_admin":false},"body":"@xiang90 can you please check","created_at":"2016-09-20T11:28:56Z","updated_at":"2016-09-20T11:28:56Z","html_url":"https://github.com/coreos/etcd/pull/6469#discussion_r79589031","pull_request_url":"https://api.github.com/repos/coreos/etcd/pulls/6469","_links":{"self":{"href":"https://api.github.com/repos/coreos/etcd/pulls/comments/79589031"},"html":{"href":"https://github.com/coreos/etcd/pull/6469#discussion_r79589031"},"pull_request":{"href":"https://api.github.com/repos/coreos/etcd/pulls/6469"}}},"pull_request":{"url":"https://api.github.com/repos/coreos/etcd/pulls/6469","id":85777165,"html_url":"https://github.com/coreos/etcd/pull/6469","diff_url":"https://github.com/coreos/etcd/pull/6469.diff","patch_url":"https://github.com/coreos/etcd/pull/6469.patch","issue_url":"https://api.github.com/repos/coreos/etcd/issues/6469","number":6469,"state":"open","locked":false,"title":"wal/wal.go : improved coverage by testing WAL.Save which causes a WAL…","user":{"login":"vimalk78","id":3284044,"avatar_url":"https://avatars.githubusercontent.com/u/3284044?v=3","gravatar_id":"","url":"https://api.github.com/users/vimalk78","html_url":"https://github.com/vimalk78","followers_url":"https://api.github.com/users/vimalk78/followers","following_url":"https://api.github.com/users/vimalk78/following{/other_user}","gists_url":"https://api.github.com/users/vimalk78/gists{/gist_id}","starred_url":"https://api.github.com/users/vimalk78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vimalk78/subscriptions","organizations_url":"https://api.github.com/users/vimalk78/orgs","repos_url":"https://api.github.com/users/vimalk78/repos","events_url":"https://api.github.com/users/vimalk78/events{/privacy}","received_events_url":"https://api.github.com/users/vimalk78/received_events","type":"User","site_admin":false},"body":"completed the TODO:\r\n\r\nwal/wal.go // TODO: add a test for this code path when refactoring the tests\r\n\r\nfiles modified:\r\nwal/wal.go : removed the TODO\r\nwal/wal_test.go : added test case TestSaveWithCut\r\n\r\nthis solves the above TODO","created_at":"2016-09-19T11:34:23Z","updated_at":"2016-09-20T11:28:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2cc1fc8622d57393070620507ac048138ad4bf69","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/coreos/etcd/pulls/6469/commits","review_comments_url":"https://api.github.com/repos/coreos/etcd/pulls/6469/comments","review_comment_url":"https://api.github.com/repos/coreos/etcd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coreos/etcd/issues/6469/comments","statuses_url":"https://api.github.com/repos/coreos/etcd/statuses/7c2039cc0983f432b8bcf41bf2fb562b0ce685c7","head":{"label":"vimalk78:wal-improve-coverage-save-with-cut","ref":"wal-improve-coverage-save-with-cut","sha":"7c2039cc0983f432b8bcf41bf2fb562b0ce685c7","user":{"login":"vimalk78","id":3284044,"avatar_url":"https://avatars.githubusercontent.com/u/3284044?v=3","gravatar_id":"","url":"https://api.github.com/users/vimalk78","html_url":"https://github.com/vimalk78","followers_url":"https://api.github.com/users/vimalk78/followers","following_url":"https://api.github.com/users/vimalk78/following{/other_user}","gists_url":"https://api.github.com/users/vimalk78/gists{/gist_id}","starred_url":"https://api.github.com/users/vimalk78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vimalk78/subscriptions","organizations_url":"https://api.github.com/users/vimalk78/orgs","repos_url":"https://api.github.com/users/vimalk78/repos","events_url":"https://api.github.com/users/vimalk78/events{/privacy}","received_events_url":"https://api.github.com/users/vimalk78/received_events","type":"User","site_admin":false},"repo":{"id":65360361,"name":"etcd","full_name":"vimalk78/etcd","owner":{"login":"vimalk78","id":3284044,"avatar_url":"https://avatars.githubusercontent.com/u/3284044?v=3","gravatar_id":"","url":"https://api.github.com/users/vimalk78","html_url":"https://github.com/vimalk78","followers_url":"https://api.github.com/users/vimalk78/followers","following_url":"https://api.github.com/users/vimalk78/following{/other_user}","gists_url":"https://api.github.com/users/vimalk78/gists{/gist_id}","starred_url":"https://api.github.com/users/vimalk78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vimalk78/subscriptions","organizations_url":"https://api.github.com/users/vimalk78/orgs","repos_url":"https://api.github.com/users/vimalk78/repos","events_url":"https://api.github.com/users/vimalk78/events{/privacy}","received_events_url":"https://api.github.com/users/vimalk78/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vimalk78/etcd","description":"Distributed reliable key-value store for the most critical data of a distributed system","fork":true,"url":"https://api.github.com/repos/vimalk78/etcd","forks_url":"https://api.github.com/repos/vimalk78/etcd/forks","keys_url":"https://api.github.com/repos/vimalk78/etcd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vimalk78/etcd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vimalk78/etcd/teams","hooks_url":"https://api.github.com/repos/vimalk78/etcd/hooks","issue_events_url":"https://api.github.com/repos/vimalk78/etcd/issues/events{/number}","events_url":"https://api.github.com/repos/vimalk78/etcd/events","assignees_url":"https://api.github.com/repos/vimalk78/etcd/assignees{/user}","branches_url":"https://api.github.com/repos/vimalk78/etcd/branches{/branch}","tags_url":"https://api.github.com/repos/vimalk78/etcd/tags","blobs_url":"https://api.github.com/repos/vimalk78/etcd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vimalk78/etcd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vimalk78/etcd/git/refs{/sha}","trees_url":"https://api.github.com/repos/vimalk78/etcd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vimalk78/etcd/statuses/{sha}","languages_url":"https://api.github.com/repos/vimalk78/etcd/languages","stargazers_url":"https://api.github.com/repos/vimalk78/etcd/stargazers","contributors_url":"https://api.github.com/repos/vimalk78/etcd/contributors","subscribers_url":"https://api.github.com/repos/vimalk78/etcd/subscribers","subscription_url":"https://api.github.com/repos/vimalk78/etcd/subscription","commits_url":"https://api.github.com/repos/vimalk78/etcd/commits{/sha}","git_commits_url":"https://api.github.com/repos/vimalk78/etcd/git/commits{/sha}","comments_url":"https://api.github.com/repos/vimalk78/etcd/comments{/number}","issue_comment_url":"https://api.github.com/repos/vimalk78/etcd/issues/comments{/number}","contents_url":"https://api.github.com/repos/vimalk78/etcd/contents/{+path}","compare_url":"https://api.github.com/repos/vimalk78/etcd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vimalk78/etcd/merges","archive_url":"https://api.github.com/repos/vimalk78/etcd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vimalk78/etcd/downloads","issues_url":"https://api.github.com/repos/vimalk78/etcd/issues{/number}","pulls_url":"https://api.github.com/repos/vimalk78/etcd/pulls{/number}","milestones_url":"https://api.github.com/repos/vimalk78/etcd/milestones{/number}","notifications_url":"https://api.github.com/repos/vimalk78/etcd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vimalk78/etcd/labels{/name}","releases_url":"https://api.github.com/repos/vimalk78/etcd/releases{/id}","deployments_url":"https://api.github.com/repos/vimalk78/etcd/deployments","created_at":"2016-08-10T07:26:47Z","updated_at":"2016-08-10T07:26:50Z","pushed_at":"2016-09-19T17:50:49Z","git_url":"git://github.com/vimalk78/etcd.git","ssh_url":"git@github.com:vimalk78/etcd.git","clone_url":"https://github.com/vimalk78/etcd.git","svn_url":"https://github.com/vimalk78/etcd","homepage":"https://coreos.com/etcd/docs/latest/","size":23429,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"coreos:master","ref":"master","sha":"2dc06787aed69d0a5c50b5b92a26b8f6d26e14f8","user":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"repo":{"id":11225014,"name":"etcd","full_name":"coreos/etcd","owner":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coreos/etcd","description":"Distributed reliable key-value store for the most critical data of a distributed system","fork":false,"url":"https://api.github.com/repos/coreos/etcd","forks_url":"https://api.github.com/repos/coreos/etcd/forks","keys_url":"https://api.github.com/repos/coreos/etcd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coreos/etcd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coreos/etcd/teams","hooks_url":"https://api.github.com/repos/coreos/etcd/hooks","issue_events_url":"https://api.github.com/repos/coreos/etcd/issues/events{/number}","events_url":"https://api.github.com/repos/coreos/etcd/events","assignees_url":"https://api.github.com/repos/coreos/etcd/assignees{/user}","branches_url":"https://api.github.com/repos/coreos/etcd/branches{/branch}","tags_url":"https://api.github.com/repos/coreos/etcd/tags","blobs_url":"https://api.github.com/repos/coreos/etcd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coreos/etcd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coreos/etcd/git/refs{/sha}","trees_url":"https://api.github.com/repos/coreos/etcd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coreos/etcd/statuses/{sha}","languages_url":"https://api.github.com/repos/coreos/etcd/languages","stargazers_url":"https://api.github.com/repos/coreos/etcd/stargazers","contributors_url":"https://api.github.com/repos/coreos/etcd/contributors","subscribers_url":"https://api.github.com/repos/coreos/etcd/subscribers","subscription_url":"https://api.github.com/repos/coreos/etcd/subscription","commits_url":"https://api.github.com/repos/coreos/etcd/commits{/sha}","git_commits_url":"https://api.github.com/repos/coreos/etcd/git/commits{/sha}","comments_url":"https://api.github.com/repos/coreos/etcd/comments{/number}","issue_comment_url":"https://api.github.com/repos/coreos/etcd/issues/comments{/number}","contents_url":"https://api.github.com/repos/coreos/etcd/contents/{+path}","compare_url":"https://api.github.com/repos/coreos/etcd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coreos/etcd/merges","archive_url":"https://api.github.com/repos/coreos/etcd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coreos/etcd/downloads","issues_url":"https://api.github.com/repos/coreos/etcd/issues{/number}","pulls_url":"https://api.github.com/repos/coreos/etcd/pulls{/number}","milestones_url":"https://api.github.com/repos/coreos/etcd/milestones{/number}","notifications_url":"https://api.github.com/repos/coreos/etcd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coreos/etcd/labels{/name}","releases_url":"https://api.github.com/repos/coreos/etcd/releases{/id}","deployments_url":"https://api.github.com/repos/coreos/etcd/deployments","created_at":"2013-07-06T21:57:21Z","updated_at":"2016-09-20T09:04:01Z","pushed_at":"2016-09-20T11:13:57Z","git_url":"git://github.com/coreos/etcd.git","ssh_url":"git@github.com:coreos/etcd.git","clone_url":"https://github.com/coreos/etcd.git","svn_url":"https://github.com/coreos/etcd","homepage":"https://coreos.com/etcd/docs/latest/","size":30834,"stargazers_count":10843,"watchers_count":10843,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1915,"mirror_url":null,"open_issues_count":134,"forks":1915,"open_issues":134,"watchers":10843,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coreos/etcd/pulls/6469"},"html":{"href":"https://github.com/coreos/etcd/pull/6469"},"issue":{"href":"https://api.github.com/repos/coreos/etcd/issues/6469"},"comments":{"href":"https://api.github.com/repos/coreos/etcd/issues/6469/comments"},"review_comments":{"href":"https://api.github.com/repos/coreos/etcd/pulls/6469/comments"},"review_comment":{"href":"https://api.github.com/repos/coreos/etcd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coreos/etcd/pulls/6469/commits"},"statuses":{"href":"https://api.github.com/repos/coreos/etcd/statuses/7c2039cc0983f432b8bcf41bf2fb562b0ce685c7"}}}}
{"actor":{"display_login":"vimalk78"}}