{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/37686689","id":37686689,"diff_hunk":"@@ -170,22 +194,21 @@ class QuotasTest extends KafkaServerTestHarness {\n     Assert.assertEquals(\"Should not have been throttled\", Double.NaN, allMetrics(consumerMetricName).value())\n   }\n \n-  def produce(p: KafkaProducer[Array[Byte], Array[Byte]], count: Int): Int = {\n-    var numBytesProduced = 0\n+  def produce(p: KafkaProducer[Array[Byte], Array[Byte]], count: Int) = {\n     for (i <- 0 to count) {\n-      val payload = i.toString.getBytes\n-      numBytesProduced += payload.length\n+      val payload = Array[Byte](100)\n       p.send(new ProducerRecord[Array[Byte], Array[Byte]](topic1, null, null, payload),\n              new ErrorLoggingCallback(topic1, null, null, true)).get()\n       Thread.sleep(1)\n     }\n-    numBytesProduced\n   }\n \n+\n   def consume(consumer: KafkaConsumer[Array[Byte], Array[Byte]], numRecords: Int) {\n     consumer.subscribe(topic1)\n     var numConsumed = 0\n     while (numConsumed < numRecords) {\n+      import scala.collection.JavaConversions._","path":"core/src/test/scala/integration/kafka/api/QuotasTest.scala","position":150,"original_position":150,"commit_id":"cd60472049dee0f515d4fc3f87bc1d6bba1eb923","original_commit_id":"cd60472049dee0f515d4fc3f87bc1d6bba1eb923","user":{"login":"jjkoshy","id":112339,"avatar_url":"https://avatars.githubusercontent.com/u/112339?v=3","gravatar_id":"","url":"https://api.github.com/users/jjkoshy","html_url":"https://github.com/jjkoshy","followers_url":"https://api.github.com/users/jjkoshy/followers","following_url":"https://api.github.com/users/jjkoshy/following{/other_user}","gists_url":"https://api.github.com/users/jjkoshy/gists{/gist_id}","starred_url":"https://api.github.com/users/jjkoshy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjkoshy/subscriptions","organizations_url":"https://api.github.com/users/jjkoshy/orgs","repos_url":"https://api.github.com/users/jjkoshy/repos","events_url":"https://api.github.com/users/jjkoshy/events{/privacy}","received_events_url":"https://api.github.com/users/jjkoshy/received_events","type":"User","site_admin":false},"body":"Is this needed?","created_at":"2015-08-21T23:17:18Z","updated_at":"2015-08-21T23:17:18Z","html_url":"https://github.com/apache/kafka/pull/160#discussion_r37686689","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/160","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/37686689"},"html":{"href":"https://github.com/apache/kafka/pull/160#discussion_r37686689"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/160"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/160","id":43082817,"html_url":"https://github.com/apache/kafka/pull/160","diff_url":"https://github.com/apache/kafka/pull/160.diff","patch_url":"https://github.com/apache/kafka/pull/160.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/160","number":160,"state":"open","locked":false,"title":"KAFKA-2442: Fixing transiently failing test","user":{"login":"auradkar","id":877969,"avatar_url":"https://avatars.githubusercontent.com/u/877969?v=3","gravatar_id":"","url":"https://api.github.com/users/auradkar","html_url":"https://github.com/auradkar","followers_url":"https://api.github.com/users/auradkar/followers","following_url":"https://api.github.com/users/auradkar/following{/other_user}","gists_url":"https://api.github.com/users/auradkar/gists{/gist_id}","starred_url":"https://api.github.com/users/auradkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auradkar/subscriptions","organizations_url":"https://api.github.com/users/auradkar/orgs","repos_url":"https://api.github.com/users/auradkar/repos","events_url":"https://api.github.com/users/auradkar/events{/privacy}","received_events_url":"https://api.github.com/users/auradkar/received_events","type":"User","site_admin":false},"body":"Made the following changes:\r\n1. Made the quotas very small. (100 and 10 bytes/sec for producer and consumer respectively)\r\n2. For the producer, I'm asserting the throttle_time with a timed loop using waitUntilTrue\r\n3. For the consumer, I'm simply calling a timed poll in a loop until the server side throttle time metric returns true","created_at":"2015-08-21T21:26:36Z","updated_at":"2015-08-21T23:17:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1dfcce993977128c7818b973d3de867c193ff15d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/160/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/160/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/160/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/cd60472049dee0f515d4fc3f87bc1d6bba1eb923","head":{"label":"auradkar:failing-test","ref":"failing-test","sha":"cd60472049dee0f515d4fc3f87bc1d6bba1eb923","user":{"login":"auradkar","id":877969,"avatar_url":"https://avatars.githubusercontent.com/u/877969?v=3","gravatar_id":"","url":"https://api.github.com/users/auradkar","html_url":"https://github.com/auradkar","followers_url":"https://api.github.com/users/auradkar/followers","following_url":"https://api.github.com/users/auradkar/following{/other_user}","gists_url":"https://api.github.com/users/auradkar/gists{/gist_id}","starred_url":"https://api.github.com/users/auradkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auradkar/subscriptions","organizations_url":"https://api.github.com/users/auradkar/orgs","repos_url":"https://api.github.com/users/auradkar/repos","events_url":"https://api.github.com/users/auradkar/events{/privacy}","received_events_url":"https://api.github.com/users/auradkar/received_events","type":"User","site_admin":false},"repo":{"id":41048608,"name":"kafka","full_name":"auradkar/kafka","owner":{"login":"auradkar","id":877969,"avatar_url":"https://avatars.githubusercontent.com/u/877969?v=3","gravatar_id":"","url":"https://api.github.com/users/auradkar","html_url":"https://github.com/auradkar","followers_url":"https://api.github.com/users/auradkar/followers","following_url":"https://api.github.com/users/auradkar/following{/other_user}","gists_url":"https://api.github.com/users/auradkar/gists{/gist_id}","starred_url":"https://api.github.com/users/auradkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auradkar/subscriptions","organizations_url":"https://api.github.com/users/auradkar/orgs","repos_url":"https://api.github.com/users/auradkar/repos","events_url":"https://api.github.com/users/auradkar/events{/privacy}","received_events_url":"https://api.github.com/users/auradkar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/auradkar/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/auradkar/kafka","forks_url":"https://api.github.com/repos/auradkar/kafka/forks","keys_url":"https://api.github.com/repos/auradkar/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/auradkar/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/auradkar/kafka/teams","hooks_url":"https://api.github.com/repos/auradkar/kafka/hooks","issue_events_url":"https://api.github.com/repos/auradkar/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/auradkar/kafka/events","assignees_url":"https://api.github.com/repos/auradkar/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/auradkar/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/auradkar/kafka/tags","blobs_url":"https://api.github.com/repos/auradkar/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/auradkar/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/auradkar/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/auradkar/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/auradkar/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/auradkar/kafka/languages","stargazers_url":"https://api.github.com/repos/auradkar/kafka/stargazers","contributors_url":"https://api.github.com/repos/auradkar/kafka/contributors","subscribers_url":"https://api.github.com/repos/auradkar/kafka/subscribers","subscription_url":"https://api.github.com/repos/auradkar/kafka/subscription","commits_url":"https://api.github.com/repos/auradkar/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/auradkar/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/auradkar/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/auradkar/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/auradkar/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/auradkar/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/auradkar/kafka/merges","archive_url":"https://api.github.com/repos/auradkar/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/auradkar/kafka/downloads","issues_url":"https://api.github.com/repos/auradkar/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/auradkar/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/auradkar/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/auradkar/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/auradkar/kafka/labels{/name}","releases_url":"https://api.github.com/repos/auradkar/kafka/releases{/id}","created_at":"2015-08-19T17:16:35Z","updated_at":"2015-08-19T17:16:38Z","pushed_at":"2015-08-21T21:23:42Z","git_url":"git://github.com/auradkar/kafka.git","ssh_url":"git@github.com:auradkar/kafka.git","clone_url":"https://github.com/auradkar/kafka.git","svn_url":"https://github.com/auradkar/kafka","homepage":null,"size":21477,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"trunk"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"6acd37720df402a665094ba1153ae200ad5d6705","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":2211243,"name":"kafka","full_name":"apache/kafka","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/kafka","description":"Mirror of Apache Kafka","fork":false,"url":"https://api.github.com/repos/apache/kafka","forks_url":"https://api.github.com/repos/apache/kafka/forks","keys_url":"https://api.github.com/repos/apache/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/kafka/teams","hooks_url":"https://api.github.com/repos/apache/kafka/hooks","issue_events_url":"https://api.github.com/repos/apache/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/apache/kafka/events","assignees_url":"https://api.github.com/repos/apache/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/apache/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/apache/kafka/tags","blobs_url":"https://api.github.com/repos/apache/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/kafka/languages","stargazers_url":"https://api.github.com/repos/apache/kafka/stargazers","contributors_url":"https://api.github.com/repos/apache/kafka/contributors","subscribers_url":"https://api.github.com/repos/apache/kafka/subscribers","subscription_url":"https://api.github.com/repos/apache/kafka/subscription","commits_url":"https://api.github.com/repos/apache/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/apache/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/kafka/merges","archive_url":"https://api.github.com/repos/apache/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/kafka/downloads","issues_url":"https://api.github.com/repos/apache/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/apache/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/kafka/labels{/name}","releases_url":"https://api.github.com/repos/apache/kafka/releases{/id}","created_at":"2011-08-15T18:06:16Z","updated_at":"2015-08-21T08:45:20Z","pushed_at":"2015-08-21T21:49:13Z","git_url":"git://github.com/apache/kafka.git","ssh_url":"git@github.com:apache/kafka.git","clone_url":"https://github.com/apache/kafka.git","svn_url":"https://github.com/apache/kafka","homepage":null,"size":29529,"stargazers_count":1821,"watchers_count":1821,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1087,"mirror_url":"git://git.apache.org/kafka.git","open_issues_count":66,"forks":1087,"open_issues":66,"watchers":1821,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/160"},"html":{"href":"https://github.com/apache/kafka/pull/160"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/160"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/160/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/160/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/160/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/cd60472049dee0f515d4fc3f87bc1d6bba1eb923"}}}}