[ https://issues.apache.org/jira/browse/KAFKA-8379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16842071#comment-16842071 ]
ASF GitHub Bot commented on KAFKA-8379: --------------------------------------- rajinisivaram commented on pull request #6753: KAFKA-8379; Fix flaky test KafkaAdminClientTest.testUnreachableBootstrapServer URL: https://github.com/apache/kafka/pull/6753 The test starts an AdminClient with a MockClient. After the admin client network thread had started, it was disconnecting one of the nodes and marking it unreachable from the main thread. This interferes with the admin client network thread, causing a timing issue if the disconnect occurred while the network thread was processing the first metadata request. This PR makes the test safer by marking the node unreachable in MockClient before starting the admin client. ### 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 KafkaAdminClientTest.testUnreachableBootstrapServer > -------------------------------------------------------------- > > Key: KAFKA-8379 > URL: https://issues.apache.org/jira/browse/KAFKA-8379 > Project: Kafka > Issue Type: Bug > Components: clients > Reporter: Rajini Sivaram > Assignee: Rajini Sivaram > Priority: Major > Fix For: 2.3.0 > > > Test failed with: > {code:java} > org.junit.runners.model.TestTimedOutException: test timed out after 120000 > milliseconds > at java.lang.Object.wait(Native Method) > at java.lang.Object.wait(Object.java:502) > at > org.apache.kafka.common.internals.KafkaFutureImpl$SingleWaiter.await(KafkaFutureImpl.java:92) > at > org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:260) > at > org.apache.kafka.clients.admin.KafkaAdminClientTest.testUnreachableBootstrapServer(KafkaAdminClientTest.java:303) > {code} > Standard output shows: > {code} > [2019-05-17 06:38:01,854] ERROR Uncaught exception in thread > 'kafka-admin-client-thread | adminclient-35': > (org.apache.kafka.common.utils.KafkaThread:51) > java.lang.IllegalStateException: Cannot send > ClientRequest(expectResponse=true, callback=null, destination=-1, > correlationId=0, clientId=mockClientId, createdTimeMs=1558075081853, > requestBuilder=MetadataRequestData(topics=[], allowAutoTopicCreation=true, > includeClusterAuthorizedOperations=false, > includeTopicAuthorizedOperations=false)) since the destination is not ready > at org.apache.kafka.clients.MockClient.send(MockClient.java:186) > at > org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.sendEligibleCalls(KafkaAdminClient.java:943) > at > org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1140) > at java.lang.Thread.run(Thread.java:748) > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)