streamnative / kop

Kafka-on-Pulsar - A protocol handler that brings native Kafka protocol to Apache Pulsar
https://streamnative.io/docs/kop
Apache License 2.0
452 stars 137 forks source link

Flaky-test: KafkaListenerNameTest #1027

Open BewareMyPower opened 2 years ago

BewareMyPower commented 2 years ago

KafkaListenerNameTest is flaky. All test method fails sporadically.

example failure

Error:  testConnectListenerNotExist(io.streamnative.pulsar.handlers.kop.KafkaListenerNameTest)  Time elapsed: 20.016 s  <<< FAILURE!
org.testng.internal.thread.ThreadTimeoutException: Method io.streamnative.pulsar.handlers.kop.KafkaListenerNameTest.testConnectListenerNotExist() didn't finish within the time-out 20000
    at java.lang.Class.getName0(Native Method)
    at java.lang.Class.getName(Class.java:642)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
    at org.apache.pulsar.client.admin.PulsarAdminException.<clinit>(PulsarAdminException.java:27)
    at org.apache.pulsar.client.admin.internal.ClustersImpl.getClusters(ClustersImpl.java:64)
    at io.streamnative.pulsar.handlers.kop.utils.MetadataUtils.createKafkaMetadataIfMissing(MetadataUtils.java:115)
    at io.streamnative.pulsar.handlers.kop.utils.MetadataUtils.createOffsetMetadataIfMissing(MetadataUtils.java:65)
    at io.streamnative.pulsar.handlers.kop.KafkaProtocolHandler.createAndBootGroupCoordinator(KafkaProtocolHandler.java:546)
    at io.streamnative.pulsar.handlers.kop.KafkaProtocolHandler$$Lambda$452/393047384.apply(Unknown Source)
    at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
    at io.streamnative.pulsar.handlers.kop.KafkaProtocolHandler.getGroupCoordinator(KafkaProtocolHandler.java:108)
    at io.streamnative.pulsar.handlers.kop.KafkaProtocolHandler.start(KafkaProtocolHandler.java:490)

Error:  testListenerName(io.streamnative.pulsar.handlers.kop.KafkaListenerNameTest)  Time elapsed: 0.16 s  <<< FAILURE!
org.apache.pulsar.broker.PulsarServerException: java.io.IOException: Failed to bind Pulsar broker on /0.0.0.0:15002
    at org.apache.pulsar.broker.PulsarService.start(PulsarService.java:783)
    at io.streamnative.pulsar.handlers.kop.KopProtocolHandlerTestBase.startBroker(KopProtocolHandlerTestBase.java:377)
    at io.streamnative.pulsar.handlers.kop.KopProtocolHandlerTestBase.startBroker(KopProtocolHandlerTestBase.java:368)
    at io.streamnative.pulsar.handlers.kop.KopProtocolHandlerTestBase.internalSetup(KopProtocolHandlerTestBase.java:284)
    at io.streamnative.pulsar.handlers.kop.KafkaListenerNameTest.testListenerName(KafkaListenerNameTest.java:143)

Error:  testMetadataRequestForMultiListeners(io.streamnative.pulsar.handlers.kop.KafkaListenerNameTest)  Time elapsed: 0.426 s  <<< FAILURE!
org.apache.pulsar.broker.PulsarServerException: java.io.IOException: Failed to bind Pulsar broker on /0.0.0.0:15002
    at org.apache.pulsar.broker.PulsarService.start(PulsarService.java:783)
    at io.streamnative.pulsar.handlers.kop.KopProtocolHandlerTestBase.startBroker(KopProtocolHandlerTestBase.java:377)
    at io.streamnative.pulsar.handlers.kop.KopProtocolHandlerTestBase.startBroker(KopProtocolHandlerTestBase.java:368)
    at io.streamnative.pulsar.handlers.kop.KopProtocolHandlerTestBase.internalSetup(KopProtocolHandlerTestBase.java:284)
    at io.streamnative.pulsar.handlers.kop.KafkaListenerNameTest.testMetadataRequestForMultiListeners(KafkaListenerNameTest.java:82)

Error:  testMultipleListenerName(io.streamnative.pulsar.handlers.kop.KafkaListenerNameTest)  Time elapsed: 0.217 s  <<< FAILURE!
org.apache.pulsar.broker.PulsarServerException: java.io.IOException: Failed to bind Pulsar broker on /0.0.0.0:15002
    at org.apache.pulsar.broker.PulsarService.start(PulsarService.java:783)
    at io.streamnative.pulsar.handlers.kop.KopProtocolHandlerTestBase.startBroker(KopProtocolHandlerTestBase.java:377)
    at io.streamnative.pulsar.handlers.kop.KopProtocolHandlerTestBase.startBroker(KopProtocolHandlerTestBase.java:368)
    at io.streamnative.pulsar.handlers.kop.KopProtocolHandlerTestBase.internalSetup(KopProtocolHandlerTestBase.java:284)
    at io.streamnative.pulsar.handlers.kop.KafkaListenerNameTest.testMultipleListenerName(KafkaListenerNameTest.java:168)

It looks like all these tests failed because the address is already in use after the first test (testConnectListenerNotExist) failed.

BewareMyPower commented 2 years ago

@Demogorgon314 Could you help with this issue?