You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Chia-Ping Tsai (Jira)" <ji...@apache.org> on 2026/09/14 00:52:00 UTC

[jira] [Created] (KAFKA-21089) Ensure the producer gets closed in KafkaProducerTest to avoid cascading failures

Chia-Ping Tsai created KAFKA-21089:
--------------------------------------

             Summary: Ensure the producer gets closed in KafkaProducerTest to avoid cascading failures
                 Key: KAFKA-21089
                 URL: https://issues.apache.org/jira/browse/KAFKA-21089
             Project: Kafka
          Issue Type: Bug
            Reporter: Chia-Ping Tsai
            Assignee: Chia-Ping Tsai


from: [https://github.com/apache/kafka/actions/runs/34763157891/job/103740045036?pr=23451]
{code:java}
Found 93 test failures:
FAILED ❌ KafkaProducerTest > testCloseIsForcedOnPendingFindCoordinator()
FAILED ❌ KafkaProducerTest > testSubscribingCustomMetricsWithSameNameDoesntAffectProducerMetrics()
FAILED ❌ KafkaProducerTest > testRetriesAndIdempotenceForIdempotentProducers()
FAILED ❌ KafkaProducerTest > testCloseWhenWaitingForMetadataUpdate()
FAILED ❌ KafkaProducerTest > testTopicExpiryInMetadata()
FAILED ❌ KafkaProducerTest > "testMetadataWithPartitionOutOfRange(boolean).isIdempotenceEnabled=true"
FAILED ❌ KafkaProducerTest > "testMetadataWithPartitionOutOfRange(boolean).isIdempotenceEnabled=false"
FAILED ❌ KafkaProducerTest > "testInitTransactionsWithKeepPreparedTxnAndTwoPhaseCommit(boolean, boolean).keepPreparedTxn=true, enable2PC=false"
FAILED ❌ KafkaProducerTest > "testInitTransactionsWithKeepPreparedTxnAndTwoPhaseCommit(boolean, boolean).keepPreparedTxn=true, enable2PC=true"
FAILED ❌ KafkaProducerTest > "testInitTransactionsWithKeepPreparedTxnAndTwoPhaseCommit(boolean, boolean).keepPreparedTxn=false, enable2PC=true"
FAILED ❌ KafkaProducerTest > testDeliveryTimeoutAndLingerMsConfig()
FAILED ❌ KafkaProducerTest > testSendOffsetsToTransactionTriggersMetadataRefreshThenNegotiatesV6()
FAILED ❌ KafkaProducerTest > testHeadersSuccess()
FAILED ❌ KafkaProducerTest > testTopicRefreshInMetadata()
FAILED ❌ KafkaProducerTest > testNullGroupMetadataInSendOffsets() {code}
Many test cases in KafkaProducerTest don't close the producer in a try-with-resources or finally block. If an assertion fails in the middle of the test, the sender thread is leaked, and every subsequent test in the class fails in {{detectLeaks}} 

Also, the root cause of that failure is a too-small timeout (2000ms) for {{client.waitForRequests}}
{code:java}
client.waitForRequests(1, 2000); {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)