[ 
https://issues.apache.org/jira/browse/KAFKA-7989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16797874#comment-16797874
 ] 

ASF GitHub Bot commented on KAFKA-7989:
---------------------------------------

apovzner commented on pull request #6482: KAFKA-7989: RequestQuotaTest should 
wait for quota config change before running tests
URL: https://github.com/apache/kafka/pull/6482
 
 
   This PR fixes KAFKA-7989 and KAFKA-8123: 
testResponseThrottleTimeWhenBothProduceAndRequestQuotasViolated and 
testResponseThrottleTimeWhenBothFetchAndRequestQuotasViolated.
   
   The failure was due to throttle-time metric for produce/consume was not 
updated. 
   
   The root cause of the failure is that test's `setUp()` sets quota configs 
for various producers/consumers, which is done through admin client, but it 
waited for only default and unthrottled client quotas to be updated; it did not 
wait for quota of smallQuotaProducerClientId and smallQuotaConsumerClientId to 
be updated. The failed tests are those that verify throttle metrics of 
smallQuotaProducerClientId and smallQuotaConsumerClientId clients. One 
important details is that default request quota and request quota of 
smallQuotaConsumer/ProducerClientId is the same == 0.01. The test failure 
happens if the test producing or consuming by the client with small quots runs 
before produce/consume quota gets updated (the default request quota is already 
small). In this case, the request gets throttled due to violating request 
quota, but not produce/consume quota, while the test expects that both types of 
quotas are violated. The fix is for the test to wait for all quotas to be 
updated in `setUp` before running tests.
   
   I was not able to reproduce the test failure locally. However, I was able to 
"reproduce" this by adding a while loop in the beginning of 
ClientQuotaManager#updateQuota(). 
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Flaky Test 
> RequestQuotaTest#testResponseThrottleTimeWhenBothFetchAndRequestQuotasViolated
> -----------------------------------------------------------------------------------------
>
>                 Key: KAFKA-7989
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7989
>             Project: Kafka
>          Issue Type: Bug
>          Components: core, unit tests
>    Affects Versions: 2.2.0
>            Reporter: Matthias J. Sax
>            Assignee: Anna Povzner
>            Priority: Critical
>              Labels: flaky-test
>             Fix For: 2.3.0, 2.2.1
>
>
> To get stable nightly builds for `2.2` release, I create tickets for all 
> observed test failures.
> [https://jenkins.confluent.io/job/apache-kafka-test/job/2.2/27/]
> {quote}java.util.concurrent.ExecutionException: java.lang.AssertionError: 
> Throttle time metrics for consumer quota not updated: 
> small-quota-consumer-client at 
> java.util.concurrent.FutureTask.report(FutureTask.java:122) at 
> java.util.concurrent.FutureTask.get(FutureTask.java:206) at 
> kafka.server.RequestQuotaTest.$anonfun$waitAndCheckResults$1(RequestQuotaTest.scala:415)
>  at scala.collection.immutable.List.foreach(List.scala:392) at 
> scala.collection.generic.TraversableForwarder.foreach(TraversableForwarder.scala:38)
>  at 
> scala.collection.generic.TraversableForwarder.foreach$(TraversableForwarder.scala:38)
>  at scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:47) at 
> kafka.server.RequestQuotaTest.waitAndCheckResults(RequestQuotaTest.scala:413) 
> at 
> kafka.server.RequestQuotaTest.testResponseThrottleTimeWhenBothFetchAndRequestQuotasViolated(RequestQuotaTest.scala:134){quote}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to