You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/03/20 10:07:00 UTC

[jira] [Commented] (KAFKA-8126) Flaky Test org.apache.kafka.connect.runtime.WorkerTest.testAddRemoveTask

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

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

adoroszlai commented on pull request #6475: [KAFKA-8126] Fix flaky tests in WorkerTest
URL: https://github.com/apache/kafka/pull/6475
 
 
   ## What changes were proposed in this pull request?
   
   Fix flaky test cases in `WorkerTest` by mocking the `ExecutorService` in `Worker`.  Previously, when using a real thread pool executor, the task may or may not have been run by the executor until the end of the test.
   
   Related JIRA issues:
   
    * [KAFKA-8126](https://issues.apache.org/jira/browse/KAFKA-8126)
    * [KAFKA-8063](https://issues.apache.org/jira/browse/KAFKA-8063)
    * [KAFKA-5141](https://issues.apache.org/jira/browse/KAFKA-5141)
   
   ## How was this patch tested?
   
   Ran all tests (`./gradlew test`).
   Ran unit tests in `connect/runtime` repeatedly.
 
----------------------------------------------------------------
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:
users@infra.apache.org


> Flaky Test org.apache.kafka.connect.runtime.WorkerTest.testAddRemoveTask
> ------------------------------------------------------------------------
>
>                 Key: KAFKA-8126
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8126
>             Project: Kafka
>          Issue Type: Improvement
>          Components: KafkaConnect, unit tests
>            Reporter: Guozhang Wang
>            Priority: Major
>
> {code}
> Stacktrace
> java.lang.AssertionError: 
>   Expectation failure on verify:
>     WorkerSourceTask.run(): expected: 1, actual: 0
> 	at org.easymock.internal.MocksControl.verify(MocksControl.java:242)
> 	at org.powermock.api.easymock.internal.invocationcontrol.EasyMockMethodInvocationControl.verify(EasyMockMethodInvocationControl.java:126)
> 	at org.powermock.api.easymock.PowerMock.verify(PowerMock.java:1476)
> 	at org.powermock.api.easymock.PowerMock.verifyAll(PowerMock.java:1415)
> 	at org.apache.kafka.connect.runtime.WorkerTest.testAddRemoveTask(WorkerTest.java:589)
> 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> 	at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:68)
> {code}
> https://builds.apache.org/job/kafka-pr-jdk11-scala2.12/3330/testReport/junit/org.apache.kafka.connect.runtime/WorkerTest/testAddRemoveTask/



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