{"action":"created","comment":{"url":"https://api.github.com/repos/openzipkin/zipkin/pulls/comments/37304844","id":37304844,"diff_hunk":"@@ -36,4 +40,23 @@ class CassandraSpanStoreSpec extends SpanStoreSpec {\n   override lazy val store = new CassandraSpanStore(new Repository(keyspace, cluster))\n \n   override def clear = cluster.connect().execute(\"DROP KEYSPACE IF EXISTS \" + keyspace)\n+\n+  override def setTimeToLive() {\n+    ready(store(Seq(span1)))\n+    ready(store.setTimeToLive(span1.traceId, 1234.seconds))\n+\n+    for( i <- 1 to 100) {\n+      // @xxx Repository.storeXXX() methods write asynchronously but don't return a Future so we can't reliably test.\n+      //  just wait and loop instead\n+      java.lang.Thread.sleep(50)\n+      // If a store doesn't use TTLs this should return Duration.Top","path":"zipkin-cassandra/src/test/scala/com/twitter/zipkin/storage/cassandra/CassandraSpanStoreSpec.scala","position":26,"original_position":26,"commit_id":"682ee44da3cdedba237f08ba99626c6b393b3b98","original_commit_id":"682ee44da3cdedba237f08ba99626c6b393b3b98","user":{"login":"abesto","id":59982,"avatar_url":"https://avatars.githubusercontent.com/u/59982?v=3","gravatar_id":"","url":"https://api.github.com/users/abesto","html_url":"https://github.com/abesto","followers_url":"https://api.github.com/users/abesto/followers","following_url":"https://api.github.com/users/abesto/following{/other_user}","gists_url":"https://api.github.com/users/abesto/gists{/gist_id}","starred_url":"https://api.github.com/users/abesto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abesto/subscriptions","organizations_url":"https://api.github.com/users/abesto/orgs","repos_url":"https://api.github.com/users/abesto/repos","events_url":"https://api.github.com/users/abesto/events{/privacy}","received_events_url":"https://api.github.com/users/abesto/received_events","type":"User","site_admin":false},"body":"But we know whether the Cassandra store uses TTLs, no? So we could just have the specialized code here?","created_at":"2015-08-18T14:32:16Z","updated_at":"2015-08-18T14:32:16Z","html_url":"https://github.com/openzipkin/zipkin/pull/627#discussion_r37304844","pull_request_url":"https://api.github.com/repos/openzipkin/zipkin/pulls/627","_links":{"self":{"href":"https://api.github.com/repos/openzipkin/zipkin/pulls/comments/37304844"},"html":{"href":"https://github.com/openzipkin/zipkin/pull/627#discussion_r37304844"},"pull_request":{"href":"https://api.github.com/repos/openzipkin/zipkin/pulls/627"}}},"pull_request":{"url":"https://api.github.com/repos/openzipkin/zipkin/pulls/627","id":42702722,"html_url":"https://github.com/openzipkin/zipkin/pull/627","diff_url":"https://github.com/openzipkin/zipkin/pull/627.diff","patch_url":"https://github.com/openzipkin/zipkin/pull/627.patch","issue_url":"https://api.github.com/repos/openzipkin/zipkin/issues/627","number":627,"state":"open","locked":false,"title":"Fix CassandraSpanStoreSpec.setTimeToLive randomly failing","user":{"login":"michaelsembwever","id":559444,"avatar_url":"https://avatars.githubusercontent.com/u/559444?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelsembwever","html_url":"https://github.com/michaelsembwever","followers_url":"https://api.github.com/users/michaelsembwever/followers","following_url":"https://api.github.com/users/michaelsembwever/following{/other_user}","gists_url":"https://api.github.com/users/michaelsembwever/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelsembwever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelsembwever/subscriptions","organizations_url":"https://api.github.com/users/michaelsembwever/orgs","repos_url":"https://api.github.com/users/michaelsembwever/repos","events_url":"https://api.github.com/users/michaelsembwever/events{/privacy}","received_events_url":"https://api.github.com/users/michaelsembwever/received_events","type":"User","site_admin":false},"body":"CassandraSpanStoreSpec.setTimeToLive was randomly failing\r\n because it has no way to know when the write for the CassandraSpanStore.setTimeToLive(..) was complete\r\n more accurately Repository.storeSpan(..), which setTimeToLive(..) calls, executes the write asynchronously but does not return any future\r\nthat the consumer can wait upon.\r\n\r\nThis could have been better implemented with properly proxing java futures onto scala/twitter futures, but the initial attempts fell into the\r\ntoo-hard basket, so all storeXX(..) methods in Repository.java just fire-and-forget.\r\n\r\nThe hack solution here was to override SpanStoreSpec.setTimeToLive in CassandraSpanStoreSpec so to keep checking for the correct result and\r\nonly after 5 seconds give up and presume the test has really failed.","created_at":"2015-08-18T14:09:04Z","updated_at":"2015-08-18T14:32:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"50dc6ca0be81ecdb36c6af0aeb7b5d3c72b95af1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openzipkin/zipkin/pulls/627/commits","review_comments_url":"https://api.github.com/repos/openzipkin/zipkin/pulls/627/comments","review_comment_url":"https://api.github.com/repos/openzipkin/zipkin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openzipkin/zipkin/issues/627/comments","statuses_url":"https://api.github.com/repos/openzipkin/zipkin/statuses/682ee44da3cdedba237f08ba99626c6b393b3b98","head":{"label":"openzipkin:bugfix/cassandra-fix-setTimeToLive-test","ref":"bugfix/cassandra-fix-setTimeToLive-test","sha":"682ee44da3cdedba237f08ba99626c6b393b3b98","user":{"login":"openzipkin","id":11860887,"avatar_url":"https://avatars.githubusercontent.com/u/11860887?v=3","gravatar_id":"","url":"https://api.github.com/users/openzipkin","html_url":"https://github.com/openzipkin","followers_url":"https://api.github.com/users/openzipkin/followers","following_url":"https://api.github.com/users/openzipkin/following{/other_user}","gists_url":"https://api.github.com/users/openzipkin/gists{/gist_id}","starred_url":"https://api.github.com/users/openzipkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openzipkin/subscriptions","organizations_url":"https://api.github.com/users/openzipkin/orgs","repos_url":"https://api.github.com/users/openzipkin/repos","events_url":"https://api.github.com/users/openzipkin/events{/privacy}","received_events_url":"https://api.github.com/users/openzipkin/received_events","type":"Organization","site_admin":false},"repo":{"id":4576305,"name":"zipkin","full_name":"openzipkin/zipkin","owner":{"login":"openzipkin","id":11860887,"avatar_url":"https://avatars.githubusercontent.com/u/11860887?v=3","gravatar_id":"","url":"https://api.github.com/users/openzipkin","html_url":"https://github.com/openzipkin","followers_url":"https://api.github.com/users/openzipkin/followers","following_url":"https://api.github.com/users/openzipkin/following{/other_user}","gists_url":"https://api.github.com/users/openzipkin/gists{/gist_id}","starred_url":"https://api.github.com/users/openzipkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openzipkin/subscriptions","organizations_url":"https://api.github.com/users/openzipkin/orgs","repos_url":"https://api.github.com/users/openzipkin/repos","events_url":"https://api.github.com/users/openzipkin/events{/privacy}","received_events_url":"https://api.github.com/users/openzipkin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openzipkin/zipkin","description":"Zipkin is a distributed tracing system","fork":false,"url":"https://api.github.com/repos/openzipkin/zipkin","forks_url":"https://api.github.com/repos/openzipkin/zipkin/forks","keys_url":"https://api.github.com/repos/openzipkin/zipkin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openzipkin/zipkin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openzipkin/zipkin/teams","hooks_url":"https://api.github.com/repos/openzipkin/zipkin/hooks","issue_events_url":"https://api.github.com/repos/openzipkin/zipkin/issues/events{/number}","events_url":"https://api.github.com/repos/openzipkin/zipkin/events","assignees_url":"https://api.github.com/repos/openzipkin/zipkin/assignees{/user}","branches_url":"https://api.github.com/repos/openzipkin/zipkin/branches{/branch}","tags_url":"https://api.github.com/repos/openzipkin/zipkin/tags","blobs_url":"https://api.github.com/repos/openzipkin/zipkin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openzipkin/zipkin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openzipkin/zipkin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openzipkin/zipkin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openzipkin/zipkin/statuses/{sha}","languages_url":"https://api.github.com/repos/openzipkin/zipkin/languages","stargazers_url":"https://api.github.com/repos/openzipkin/zipkin/stargazers","contributors_url":"https://api.github.com/repos/openzipkin/zipkin/contributors","subscribers_url":"https://api.github.com/repos/openzipkin/zipkin/subscribers","subscription_url":"https://api.github.com/repos/openzipkin/zipkin/subscription","commits_url":"https://api.github.com/repos/openzipkin/zipkin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openzipkin/zipkin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openzipkin/zipkin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openzipkin/zipkin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openzipkin/zipkin/contents/{+path}","compare_url":"https://api.github.com/repos/openzipkin/zipkin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openzipkin/zipkin/merges","archive_url":"https://api.github.com/repos/openzipkin/zipkin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openzipkin/zipkin/downloads","issues_url":"https://api.github.com/repos/openzipkin/zipkin/issues{/number}","pulls_url":"https://api.github.com/repos/openzipkin/zipkin/pulls{/number}","milestones_url":"https://api.github.com/repos/openzipkin/zipkin/milestones{/number}","notifications_url":"https://api.github.com/repos/openzipkin/zipkin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openzipkin/zipkin/labels{/name}","releases_url":"https://api.github.com/repos/openzipkin/zipkin/releases{/id}","created_at":"2012-06-06T18:26:16Z","updated_at":"2015-08-18T14:23:45Z","pushed_at":"2015-08-18T14:09:05Z","git_url":"git://github.com/openzipkin/zipkin.git","ssh_url":"git@github.com:openzipkin/zipkin.git","clone_url":"https://github.com/openzipkin/zipkin.git","svn_url":"https://github.com/openzipkin/zipkin","homepage":"http://zipkin.io","size":13371,"stargazers_count":2576,"watchers_count":2576,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":358,"mirror_url":null,"open_issues_count":67,"forks":358,"open_issues":67,"watchers":2576,"default_branch":"master"}},"base":{"label":"openzipkin:master","ref":"master","sha":"93f1e9287b49819dcafbbedb4ea838879a679f7a","user":{"login":"openzipkin","id":11860887,"avatar_url":"https://avatars.githubusercontent.com/u/11860887?v=3","gravatar_id":"","url":"https://api.github.com/users/openzipkin","html_url":"https://github.com/openzipkin","followers_url":"https://api.github.com/users/openzipkin/followers","following_url":"https://api.github.com/users/openzipkin/following{/other_user}","gists_url":"https://api.github.com/users/openzipkin/gists{/gist_id}","starred_url":"https://api.github.com/users/openzipkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openzipkin/subscriptions","organizations_url":"https://api.github.com/users/openzipkin/orgs","repos_url":"https://api.github.com/users/openzipkin/repos","events_url":"https://api.github.com/users/openzipkin/events{/privacy}","received_events_url":"https://api.github.com/users/openzipkin/received_events","type":"Organization","site_admin":false},"repo":{"id":4576305,"name":"zipkin","full_name":"openzipkin/zipkin","owner":{"login":"openzipkin","id":11860887,"avatar_url":"https://avatars.githubusercontent.com/u/11860887?v=3","gravatar_id":"","url":"https://api.github.com/users/openzipkin","html_url":"https://github.com/openzipkin","followers_url":"https://api.github.com/users/openzipkin/followers","following_url":"https://api.github.com/users/openzipkin/following{/other_user}","gists_url":"https://api.github.com/users/openzipkin/gists{/gist_id}","starred_url":"https://api.github.com/users/openzipkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openzipkin/subscriptions","organizations_url":"https://api.github.com/users/openzipkin/orgs","repos_url":"https://api.github.com/users/openzipkin/repos","events_url":"https://api.github.com/users/openzipkin/events{/privacy}","received_events_url":"https://api.github.com/users/openzipkin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openzipkin/zipkin","description":"Zipkin is a distributed tracing system","fork":false,"url":"https://api.github.com/repos/openzipkin/zipkin","forks_url":"https://api.github.com/repos/openzipkin/zipkin/forks","keys_url":"https://api.github.com/repos/openzipkin/zipkin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openzipkin/zipkin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openzipkin/zipkin/teams","hooks_url":"https://api.github.com/repos/openzipkin/zipkin/hooks","issue_events_url":"https://api.github.com/repos/openzipkin/zipkin/issues/events{/number}","events_url":"https://api.github.com/repos/openzipkin/zipkin/events","assignees_url":"https://api.github.com/repos/openzipkin/zipkin/assignees{/user}","branches_url":"https://api.github.com/repos/openzipkin/zipkin/branches{/branch}","tags_url":"https://api.github.com/repos/openzipkin/zipkin/tags","blobs_url":"https://api.github.com/repos/openzipkin/zipkin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openzipkin/zipkin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openzipkin/zipkin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openzipkin/zipkin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openzipkin/zipkin/statuses/{sha}","languages_url":"https://api.github.com/repos/openzipkin/zipkin/languages","stargazers_url":"https://api.github.com/repos/openzipkin/zipkin/stargazers","contributors_url":"https://api.github.com/repos/openzipkin/zipkin/contributors","subscribers_url":"https://api.github.com/repos/openzipkin/zipkin/subscribers","subscription_url":"https://api.github.com/repos/openzipkin/zipkin/subscription","commits_url":"https://api.github.com/repos/openzipkin/zipkin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openzipkin/zipkin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openzipkin/zipkin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openzipkin/zipkin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openzipkin/zipkin/contents/{+path}","compare_url":"https://api.github.com/repos/openzipkin/zipkin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openzipkin/zipkin/merges","archive_url":"https://api.github.com/repos/openzipkin/zipkin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openzipkin/zipkin/downloads","issues_url":"https://api.github.com/repos/openzipkin/zipkin/issues{/number}","pulls_url":"https://api.github.com/repos/openzipkin/zipkin/pulls{/number}","milestones_url":"https://api.github.com/repos/openzipkin/zipkin/milestones{/number}","notifications_url":"https://api.github.com/repos/openzipkin/zipkin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openzipkin/zipkin/labels{/name}","releases_url":"https://api.github.com/repos/openzipkin/zipkin/releases{/id}","created_at":"2012-06-06T18:26:16Z","updated_at":"2015-08-18T14:23:45Z","pushed_at":"2015-08-18T14:09:05Z","git_url":"git://github.com/openzipkin/zipkin.git","ssh_url":"git@github.com:openzipkin/zipkin.git","clone_url":"https://github.com/openzipkin/zipkin.git","svn_url":"https://github.com/openzipkin/zipkin","homepage":"http://zipkin.io","size":13371,"stargazers_count":2576,"watchers_count":2576,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":358,"mirror_url":null,"open_issues_count":67,"forks":358,"open_issues":67,"watchers":2576,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openzipkin/zipkin/pulls/627"},"html":{"href":"https://github.com/openzipkin/zipkin/pull/627"},"issue":{"href":"https://api.github.com/repos/openzipkin/zipkin/issues/627"},"comments":{"href":"https://api.github.com/repos/openzipkin/zipkin/issues/627/comments"},"review_comments":{"href":"https://api.github.com/repos/openzipkin/zipkin/pulls/627/comments"},"review_comment":{"href":"https://api.github.com/repos/openzipkin/zipkin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openzipkin/zipkin/pulls/627/commits"},"statuses":{"href":"https://api.github.com/repos/openzipkin/zipkin/statuses/682ee44da3cdedba237f08ba99626c6b393b3b98"}}}}