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

Adrian Preston commented on KAFKA-1858:
---------------------------------------

As per the description in the bug report - the patch tightens up checking by 
comparing the threads running when a test starts with the tests running when 
the test completes.  If any new Kafka threads are found, the test is failed 
with an AssertionFailedError containing a list of the new threads.

> Make ServerShutdownTest a bit less flaky
> ----------------------------------------
>
>                 Key: KAFKA-1858
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1858
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Gwen Shapira
>         Attachments: KAFKA-1858.patch
>
>
> ServerShutdownTest currently:
> * Starts a KafkaServer
> * Does stuff
> * Stops the server
> * Counts if there are any live kafka threads
> This is fine on its own. But when running in a test suite (i.e gradle test), 
> the test is very very sensitive to any other test freeing all resources. If 
> you start a server in a previous test and forgot to close it, the 
> ServerShutdownTest will find threads from the previous test and fail.
> This makes for a flaky test that is pretty challenging to troubleshoot.
> I suggest counting the threads at the beginning and end of each test in the 
> class, and only failing if the number at the end is greater than the number 
> at the beginning.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to