aravind-kvs opened a new pull request, #22575: URL: https://github.com/apache/kafka/pull/22575
JIRA: https://issues.apache.org/jira/browse/KAFKA-20677 ## Problem The existing `testCannotSendToInternalTopic` test was broken. It attempted to cover case 2 (auto.create.topics.enable=false, topic exists) but incorrectly created and then deleted the internal topic before sending, accidentally testing the wrong scenario. ## Changes Replaced the broken test with four separate test cases covering all scenarios when sending to an internal topic: 1. `auto.create.topics.enable=true`, topic exists → `InvalidTopicException` 2. `auto.create.topics.enable=false`, topic exists → `InvalidTopicException` 3. `auto.create.topics.enable=true`, topic not exists → `InvalidTopicException` and topic gets auto-created 4. `auto.create.topics.enable=false`, topic not exists → `TimeoutException` and topic is NOT created ## Note on Case 4 The JIRA describes case 4 as throwing `UnknownTopicOrPartitionException`. However, the actual broker behavior is to return `UNKNOWN_TOPIC_OR_PARTITION` as a recoverable error, causing the producer to retry until `TimeoutException`. The test reflects actual broker behavior. ## Test Ran the new test cases locally and all 4 passed: ./gradlew :clients:clients-integration-tests:test --tests "org.apache.kafka.clients.producer.ProducerFailureHandlingTest.testCannotSendToInternalTopic*" Results: 4 tests completed, 0 failed -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
