databird07 opened a new pull request, #20360: URL: https://github.com/apache/hudi/pull/20360
### Describe the issue this Pull Request addresses Flaky Kafka-source tests: `KafkaTestUtils.createTopic` returned before partition leaders were elected, and `sendMessages` never checked the producer futures. Producing right after topic creation could drop records silently. For example, `TestHoodieDeltaStreamer#testLogicalTypesWithJsonSource` reported "expected 1000, found 974" after a 122s delivery timeout in 1 of 20 local runs. Surefire's rerun hid the failure. ### Summary and Changelog - `createTopic` polls `describeTopics` until every partition has a leader (60s monotonic deadline). It uses `values().get(topic).get()` so it stays compatible with kafka-clients 2.8.1, and it restores the interrupt flag. - Both `sendMessages` overloads wait on every send future after `flush()`. A failed send now throws `IllegalStateException` with the Kafka cause. ### Impact Test-only. 20 + 5 runs of the 22 Kafka-source tests that use these helpers passed with no failures or reruns. A deliberately oversized record now surfaces as an exception. ### Risk Level low. Test utility only. A test that previously lost records silently now fails loudly. ### Documentation Update none ### Contributor's checklist - [x] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute) - [x] Enough context is provided in the sections above - [x] Adequate tests were added if applicable -- 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]
