{"action":"created","comment":{"url":"https://api.github.com/repos/googleapis/nodejs-bigtable/pulls/comments/194088301","pull_request_review_id":127199131,"id":194088301,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDA4ODMwMQ==","diff_hunk":"@@ -1378,6 +1378,233 @@ describe('Bigtable/Table', function() {\n     });\n   });\n \n+  describe('waitForReplication', function() {\n+    it('should return the error to the callback', function(done) {\n+      var error = new Error('err');\n+\n+      table.bigtable.request = function(config, callback) {\n+        callback(error);\n+      };\n+\n+      table.waitForReplication(function(err) {\n+        assert.strictEqual(err, error);\n+        done();\n+      });\n+    });\n+\n+    it('should call checkConsistency', done => {\n+      var response = {\n+        consistency_token: 'sample-token12345',\n+      };\n+\n+      table.generateConsistencyToken = function(callback) {\n+        callback(null, response);\n+      };\n+\n+      table.checkConsistency = function(token, callback) {\n+        assert.strictEqual(token, response.consistency_token);\n+        callback(null, {consistent: true});\n+      };\n+\n+      table.waitForReplication(() => {\n+        done();\n+      });\n+    });\n+\n+    describe('retries', () => {\n+      let clock;\n+      let setTimeoutSpy;\n+      let clearTimeoutSpy;\n+      let checkConsistencySpy;\n+      let responses;\n+\n+      beforeEach(() => {\n+        clock = sinon.useFakeTimers({\n+          toFake: ['setTimeout', 'clearTimeout'],\n+        });\n+        setTimeoutSpy = sinon.spy(global, 'setTimeout');\n+        clearTimeoutSpy = sinon.spy(global, 'clearTimeout');\n+        checkConsistencySpy = sinon.spy(table, 'checkConsistency');\n+      });\n+\n+      afterEach(() => {\n+        clock.restore();\n+      });\n+\n+      it('should return true if token is consistent', function(done) {\n+        responses = [\n+          (config, callback) =>\n+            callback(null, [{consistency_token: 'sample-token12345'}]),\n+          (config, callback) => callback(null, {consistent: true}),\n+        ];\n+\n+        table.bigtable.request = function(config, callback) {","path":"test/table.js","position":64,"original_position":64,"commit_id":"28f6412038a59e9c140295aaa1baeec2225e5a2e","original_commit_id":"28f6412038a59e9c140295aaa1baeec2225e5a2e","user":{"login":"kolodny","id":1187604,"node_id":"MDQ6VXNlcjExODc2MDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1187604?v=4","gravatar_id":"","url":"https://api.github.com/users/kolodny","html_url":"https://github.com/kolodny","followers_url":"https://api.github.com/users/kolodny/followers","following_url":"https://api.github.com/users/kolodny/following{/other_user}","gists_url":"https://api.github.com/users/kolodny/gists{/gist_id}","starred_url":"https://api.github.com/users/kolodny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kolodny/subscriptions","organizations_url":"https://api.github.com/users/kolodny/orgs","repos_url":"https://api.github.com/users/kolodny/repos","events_url":"https://api.github.com/users/kolodny/events{/privacy}","received_events_url":"https://api.github.com/users/kolodny/received_events","type":"User","site_admin":false},"body":"Set this in the beforeEach block","created_at":"2018-06-08T15:07:11Z","updated_at":"2018-06-08T15:09:37Z","html_url":"https://github.com/googleapis/nodejs-bigtable/pull/82#discussion_r194088301","pull_request_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/pulls/82","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/googleapis/nodejs-bigtable/pulls/comments/194088301"},"html":{"href":"https://github.com/googleapis/nodejs-bigtable/pull/82#discussion_r194088301"},"pull_request":{"href":"https://api.github.com/repos/googleapis/nodejs-bigtable/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/googleapis/nodejs-bigtable/pulls/82","id":180991953,"node_id":"MDExOlB1bGxSZXF1ZXN0MTgwOTkxOTUz","html_url":"https://github.com/googleapis/nodejs-bigtable/pull/82","diff_url":"https://github.com/googleapis/nodejs-bigtable/pull/82.diff","patch_url":"https://github.com/googleapis/nodejs-bigtable/pull/82.patch","issue_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/issues/82","number":82,"state":"open","locked":false,"title":"added waitForReplication method to implement consistency-token check","user":{"login":"vijay-qlogic","id":36055624,"node_id":"MDQ6VXNlcjM2MDU1NjI0","avatar_url":"https://avatars1.githubusercontent.com/u/36055624?v=4","gravatar_id":"","url":"https://api.github.com/users/vijay-qlogic","html_url":"https://github.com/vijay-qlogic","followers_url":"https://api.github.com/users/vijay-qlogic/followers","following_url":"https://api.github.com/users/vijay-qlogic/following{/other_user}","gists_url":"https://api.github.com/users/vijay-qlogic/gists{/gist_id}","starred_url":"https://api.github.com/users/vijay-qlogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vijay-qlogic/subscriptions","organizations_url":"https://api.github.com/users/vijay-qlogic/orgs","repos_url":"https://api.github.com/users/vijay-qlogic/repos","events_url":"https://api.github.com/users/vijay-qlogic/events{/privacy}","received_events_url":"https://api.github.com/users/vijay-qlogic/received_events","type":"User","site_admin":false},"body":"Fixes #<issue_number_goes_here> (it's a good idea to open an issue first for discussion)\r\n\r\n- [ ] Tests and linter pass\r\n- [ ] Code coverage does not decrease (if any source code was changed)\r\n- [ ] Appropriate docs were updated (if necessary)\r\nI'll update test-cases shortly","created_at":"2018-04-11T18:37:20Z","updated_at":"2018-06-08T15:09:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d08325ab1f12944c8864e20ee2065cdd2ab5ee58","assignee":{"login":"sduskis","id":99305,"node_id":"MDQ6VXNlcjk5MzA1","avatar_url":"https://avatars3.githubusercontent.com/u/99305?v=4","gravatar_id":"","url":"https://api.github.com/users/sduskis","html_url":"https://github.com/sduskis","followers_url":"https://api.github.com/users/sduskis/followers","following_url":"https://api.github.com/users/sduskis/following{/other_user}","gists_url":"https://api.github.com/users/sduskis/gists{/gist_id}","starred_url":"https://api.github.com/users/sduskis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sduskis/subscriptions","organizations_url":"https://api.github.com/users/sduskis/orgs","repos_url":"https://api.github.com/users/sduskis/repos","events_url":"https://api.github.com/users/sduskis/events{/privacy}","received_events_url":"https://api.github.com/users/sduskis/received_events","type":"User","site_admin":false},"assignees":[{"login":"sduskis","id":99305,"node_id":"MDQ6VXNlcjk5MzA1","avatar_url":"https://avatars3.githubusercontent.com/u/99305?v=4","gravatar_id":"","url":"https://api.github.com/users/sduskis","html_url":"https://github.com/sduskis","followers_url":"https://api.github.com/users/sduskis/followers","following_url":"https://api.github.com/users/sduskis/following{/other_user}","gists_url":"https://api.github.com/users/sduskis/gists{/gist_id}","starred_url":"https://api.github.com/users/sduskis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sduskis/subscriptions","organizations_url":"https://api.github.com/users/sduskis/orgs","repos_url":"https://api.github.com/users/sduskis/repos","events_url":"https://api.github.com/users/sduskis/events{/privacy}","received_events_url":"https://api.github.com/users/sduskis/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":728773886,"node_id":"MDU6TGFiZWw3Mjg3NzM4ODY=","url":"https://api.github.com/repos/googleapis/nodejs-bigtable/labels/cla:%20yes","name":"cla: yes","color":"c2e0c6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/pulls/82/commits","review_comments_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/pulls/82/comments","review_comment_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/issues/82/comments","statuses_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/statuses/28f6412038a59e9c140295aaa1baeec2225e5a2e","head":{"label":"vijay-qlogic:consistency-token-check","ref":"consistency-token-check","sha":"28f6412038a59e9c140295aaa1baeec2225e5a2e","user":{"login":"vijay-qlogic","id":36055624,"node_id":"MDQ6VXNlcjM2MDU1NjI0","avatar_url":"https://avatars1.githubusercontent.com/u/36055624?v=4","gravatar_id":"","url":"https://api.github.com/users/vijay-qlogic","html_url":"https://github.com/vijay-qlogic","followers_url":"https://api.github.com/users/vijay-qlogic/followers","following_url":"https://api.github.com/users/vijay-qlogic/following{/other_user}","gists_url":"https://api.github.com/users/vijay-qlogic/gists{/gist_id}","starred_url":"https://api.github.com/users/vijay-qlogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vijay-qlogic/subscriptions","organizations_url":"https://api.github.com/users/vijay-qlogic/orgs","repos_url":"https://api.github.com/users/vijay-qlogic/repos","events_url":"https://api.github.com/users/vijay-qlogic/events{/privacy}","received_events_url":"https://api.github.com/users/vijay-qlogic/received_events","type":"User","site_admin":false},"repo":{"id":124574551,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQ1NzQ1NTE=","name":"nodejs-bigtable","full_name":"vijay-qlogic/nodejs-bigtable","owner":{"login":"vijay-qlogic","id":36055624,"node_id":"MDQ6VXNlcjM2MDU1NjI0","avatar_url":"https://avatars1.githubusercontent.com/u/36055624?v=4","gravatar_id":"","url":"https://api.github.com/users/vijay-qlogic","html_url":"https://github.com/vijay-qlogic","followers_url":"https://api.github.com/users/vijay-qlogic/followers","following_url":"https://api.github.com/users/vijay-qlogic/following{/other_user}","gists_url":"https://api.github.com/users/vijay-qlogic/gists{/gist_id}","starred_url":"https://api.github.com/users/vijay-qlogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vijay-qlogic/subscriptions","organizations_url":"https://api.github.com/users/vijay-qlogic/orgs","repos_url":"https://api.github.com/users/vijay-qlogic/repos","events_url":"https://api.github.com/users/vijay-qlogic/events{/privacy}","received_events_url":"https://api.github.com/users/vijay-qlogic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vijay-qlogic/nodejs-bigtable","description":"Node.js client for Google Cloud Bigtable: Google's NoSQL Big Data database service.","fork":true,"url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable","forks_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/forks","keys_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/teams","hooks_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/hooks","issue_events_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/issues/events{/number}","events_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/events","assignees_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/assignees{/user}","branches_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/branches{/branch}","tags_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/tags","blobs_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/git/refs{/sha}","trees_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/statuses/{sha}","languages_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/languages","stargazers_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/stargazers","contributors_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/contributors","subscribers_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/subscribers","subscription_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/subscription","commits_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/commits{/sha}","git_commits_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/git/commits{/sha}","comments_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/comments{/number}","issue_comment_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/issues/comments{/number}","contents_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/contents/{+path}","compare_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/merges","archive_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/downloads","issues_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/issues{/number}","pulls_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/pulls{/number}","milestones_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/milestones{/number}","notifications_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/labels{/name}","releases_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/releases{/id}","deployments_url":"https://api.github.com/repos/vijay-qlogic/nodejs-bigtable/deployments","created_at":"2018-03-09T17:50:30Z","updated_at":"2018-06-06T14:57:46Z","pushed_at":"2018-06-08T02:00:52Z","git_url":"git://github.com/vijay-qlogic/nodejs-bigtable.git","ssh_url":"git@github.com:vijay-qlogic/nodejs-bigtable.git","clone_url":"https://github.com/vijay-qlogic/nodejs-bigtable.git","svn_url":"https://github.com/vijay-qlogic/nodejs-bigtable","homepage":"https://cloud.google.com/bigtable/","size":1230,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"googleapis:master","ref":"master","sha":"20fd2e454ac391dd54161af743c6722b4cef2851","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars3.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":98463312,"node_id":"MDEwOlJlcG9zaXRvcnk5ODQ2MzMxMg==","name":"nodejs-bigtable","full_name":"googleapis/nodejs-bigtable","owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars3.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/googleapis/nodejs-bigtable","description":"Node.js client for Google Cloud Bigtable: Google's NoSQL Big Data database service.","fork":false,"url":"https://api.github.com/repos/googleapis/nodejs-bigtable","forks_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/forks","keys_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/teams","hooks_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/hooks","issue_events_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/events","assignees_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/tags","blobs_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/languages","stargazers_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/stargazers","contributors_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/contributors","subscribers_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/subscribers","subscription_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/subscription","commits_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/merges","archive_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/downloads","issues_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/nodejs-bigtable/deployments","created_at":"2017-07-26T20:29:37Z","updated_at":"2018-06-07T17:08:43Z","pushed_at":"2018-06-08T14:45:16Z","git_url":"git://github.com/googleapis/nodejs-bigtable.git","ssh_url":"git@github.com:googleapis/nodejs-bigtable.git","clone_url":"https://github.com/googleapis/nodejs-bigtable.git","svn_url":"https://github.com/googleapis/nodejs-bigtable","homepage":"https://cloud.google.com/bigtable/","size":1184,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":18,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":18,"open_issues":18,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/nodejs-bigtable/pulls/82"},"html":{"href":"https://github.com/googleapis/nodejs-bigtable/pull/82"},"issue":{"href":"https://api.github.com/repos/googleapis/nodejs-bigtable/issues/82"},"comments":{"href":"https://api.github.com/repos/googleapis/nodejs-bigtable/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/nodejs-bigtable/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/nodejs-bigtable/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/nodejs-bigtable/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/nodejs-bigtable/statuses/28f6412038a59e9c140295aaa1baeec2225e5a2e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kolodny"}}