chia7712 commented on pull request #10006:
URL: https://github.com/apache/kafka/pull/10006#issuecomment-770394615


   @hachikuji According to my experience of using Mockito, it can caused 
undefined behavior if we change class loader in mocking/spying object. Hence, I 
traced client tests and there is a test case 
```AbstractConfigTest#testClassConfigs``` 
(https://github.com/apache/kafka/blob/trunk/clients/src/test/java/org/apache/kafka/common/config/AbstractConfigTest.java#L280)
 which does not reset the class loader. Hence, the class loader is changed if 
```AbstractConfigTest``` and ```FetcherTest``` are executed in same JVM. I 
reset the class loader and loop clients tests 30 times. ```FetcherTest``` pass.
   
   This patch is ok to me. Personally, we could make 
```AbstractConfigTest#testClassConfigs``` reset class loader to avoid similar 
issues in the future.


----------------------------------------------------------------
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


Reply via email to