[ https://issues.apache.org/jira/browse/KAFKA-1501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14128928#comment-14128928 ]
Abhishek Sharma commented on KAFKA-1501: ---------------------------------------- Running an entire test class again is not a good approach (I think so). I think catching specific exception and retrying again in catch block with alternative port seems to be more efficient. This needs a change only in test class and I think that should be OK. Other approach is like we can we have another util function in TestUtils class for getting connection with same approach. What you think about taking an input from some other on this? > transient unit tests failures due to port already in use > -------------------------------------------------------- > > Key: KAFKA-1501 > URL: https://issues.apache.org/jira/browse/KAFKA-1501 > Project: Kafka > Issue Type: Improvement > Components: core > Reporter: Jun Rao > Labels: newbie > > Saw the following transient failures. > kafka.api.ProducerFailureHandlingTest > testTooLargeRecordWithAckOne FAILED > kafka.common.KafkaException: Socket server failed to bind to > localhost:59909: Address already in use. > at kafka.network.Acceptor.openServerSocket(SocketServer.scala:195) > at kafka.network.Acceptor.<init>(SocketServer.scala:141) > at kafka.network.SocketServer.startup(SocketServer.scala:68) > at kafka.server.KafkaServer.startup(KafkaServer.scala:95) > at kafka.utils.TestUtils$.createServer(TestUtils.scala:123) > at > kafka.api.ProducerFailureHandlingTest.setUp(ProducerFailureHandlingTest.scala:68) -- This message was sent by Atlassian JIRA (v6.3.4#6332)