You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "Kezhu Wang (Jira)" <ji...@apache.org> on 2022/06/28 07:21:00 UTC

[jira] [Comment Edited] (ZOOKEEPER-4327) Flaky test: RequestThrottlerTest

|  ![](cid:jira-generated-image-avatar-b3aea79a-3fc7-461a-a2f9-551c9463d062) |
[Kezhu
Wang](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=kezhuw)
**edited a comment** on [![Sub-task](cid:jira-generated-image-
avatar-8bdfcbe5-f659-4f93-9a34-188a19e85c9a)
ZOOKEEPER-4327](https://issues.apache.org/jira/browse/ZOOKEEPER-4327)  
---|---  
|  
---  
|  [Re: Flaky test:
RequestThrottlerTest](https://issues.apache.org/jira/browse/ZOOKEEPER-4327)  
---  
|  {{RequestThrottlerTest.testLargeRequestThrottling}} is flaky still. I saw
two kind of failures:  
#
https://github.com/apache/zookeeper/runs/5008842173?check_suite_focus=true#step:7:957  
  {noformat}RequestThrottlerTest. testRequestThrottler
testLargeRequestThrottling : 206 299 expected: <5> but was: <4>{noformat}  
#
https://github.com/apache/zookeeper/runs/5284250979?check_suite_focus=true#step:7:957  
  {noformat}RequestThrottlerTest.testLargeRequestThrottling:297 expected: <2>
but was: <0>{noformat}  
  
For #1, I think it is caused by mistake in {{createCallback}}.  
  
{code:java}  
        AsyncCallback.StringCallback createCallback = (rc, path, ctx, name) -> {  
            if (KeeperException.Code.get(rc) == KeeperException.Code.CONNECTIONLOSS) {  
                disconnected.countDown();  
                connectionLossCount++;  
            }  
        };  
{code}  
  
{{disconnected.countDown()}} should placed after {{connectionLossCount++}}, so
we can assert on {{connectionLossCount}} after {{disconnected.await}}. But I
think a more comfortable fix is to assert on result of {{disconnected.await}},
so timeout await can be easily figure out.  
  
For #2, I think it is caused by synchronous request rejection in
{{ServerCnxn}} thread and asynchronous request submission in
{{RequestThrottler.submitRequest}}. I think we can fix this by moving metrics
read and assertion after {{finished.await}}.  
  
[~eolivelli] [~maoling] What do you think ?  
---  
|  |  [ ![Add Comment](cid:jira-generated-image-static-comment-icon-
dd91a9e0-16c1-4854-8104-cb0b5b805e5c)
](https://issues.apache.org/jira/browse/ZOOKEEPER-4327#add-comment "Add
Comment") |  [Add
Comment](https://issues.apache.org/jira/browse/ZOOKEEPER-4327#add-comment "Add
Comment")  
---|---  
  
|  This message was sent by Atlassian Jira (v8.20.10#820010-sha1:ace47f9) |  |
![Atlassian logo](https://issues.apache.org/jira/images/mail/atlassian-email-
logo.png)  
---