C0urante opened a new pull request, #14966:
URL: https://github.com/apache/kafka/pull/14966

   [Jira](https://issues.apache.org/jira/browse/KAFKA-15988)
   
   Using a similar approach to the existing [ConnectorRestartApiIntegrationTest 
suite](https://github.com/apache/kafka/blob/c062e5a1f91f44c721072a29b533304d58c487ab/connect/runtime/src/test/java/org/apache/kafka/connect/integration/ConnectorRestartApiIntegrationTest.java#L83-L129),
 embedded Kafka clusters and embedded Connect clusters that use the same worker 
configs are reused across test cases.
   
   In order to reduce possible interference across test cases, the name of the 
connector and the topic it interacts with for each case is derived from the 
name of the test case. In the same vein, overridden sink connector group IDs 
and source connector offsets topics are also derived from the name of the test 
case.
   
   Although the diff is a few hundred lines long, it mostly boils down to these 
simple changes:
   - Replace the `CONNECTOR_NAME` constant with the `connectorName` field
   - Replace the `TOPIC` constant with the `topic` field
   - Replace hardcoded overridden sink connector consumer group IDs and source 
connector offsets topics with names that now include the test case
   - Add an internal API to reuse `EmbeddedConnectCluster` instances (based on 
their worker configs) across tests, which also reuses their underlying 
`EmbeddedKafkaCluster` instances
   - Add cleanup logic at the end of each test to delete the test-specific 
connector, and fail the test if any other leaked connectors are found
   
   The last point does mean that we may double the number of 
concurrently-running embedded Kafka and Connect clusters. With local testing, 
this was worth the tradeoff: test runtime decreased from 6 minutes and 17 
seconds to 3 minutes and 27 seconds. However, we may explore an improvement in 
the future where we order tests by the kind of embedded Connect cluster they 
require, and bring down any currently-running embedded Connect cluster before 
bringing up a new one.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to