Remove dependencies on deprecated --zookeeper command flags in junit tests#8527
Conversation
|
|
||
| val passwordConfigs = sslStoreProps.asScala.keySet.filter(DynamicBrokerConfig.isPasswordConfig) | ||
| val passwordEncoderConfigs = new Properties | ||
| passwordEncoderConfigs ++= sslStoreProps.asScala.filter { case (key, _) => key.startsWith("password.encoder.") } |
There was a problem hiding this comment.
Hmm. Do we need this if we have passwordConfigs?
There was a problem hiding this comment.
Good catch. Deleted.
|
For The goal should be to remove unnecessary dependencies on the deprecated zookeeper command code. |
| val props = new Properties() | ||
| props.setProperty(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, TestUtils.getBrokerListStrFromServers(servers)) | ||
| val adminClient = Admin.create(props) | ||
| adminClient.createPartitions(Map(topic -> NewPartitions.increaseTo(2)).asJava) |
There was a problem hiding this comment.
There should be a "get" here to ensure that we actually create the partitions before shutting down, right?
There was a problem hiding this comment.
Good catch. Although this will return an API exception (can't increase partition number during topic deletion), we still need to wait for the completion.
| def shouldNotAllowBrokersListWithVerifyOption(): Unit = { | ||
| val args = Array( | ||
| "--zookeeper", "localhost:1234", | ||
| "--bootstrap-server", "localhost:1234", |
There was a problem hiding this comment.
This is a good change since the test is not specifically testing the legacy mode (so it should use the new mode) Keep this one
| def shouldNotAllowTopicsOptionWithVerify(): Unit = { | ||
| val args = Array( | ||
| "--zookeeper", "localhost:1234", | ||
| "--bootstrap-server", "localhost:1234", |
| def shouldNotAllowThrottleWithVerifyOption(): Unit = { | ||
| val args = Array( | ||
| "--zookeeper", "localhost:1234", | ||
| "--bootstrap-server", "localhost:1234", |
| } | ||
|
|
||
| @Test | ||
| def testCreateWithUnspecifiedReplicationFactorAndPartitionsWithZkClient(): Unit = { |
There was a problem hiding this comment.
It's weird that this is even in this file. This should be moved to TopicCommandWithZKClientTest.scala, I think
There was a problem hiding this comment.
Yes. If we are ignoring the tests instead of deleting the tests, we should move this one into TopicCommandWithZKClientTest.scala
|
ok to test |
|
Looks like the JDK8 build flaked. We've got some things to fix before re-running in any case. |
|
ok to test |
1 similar comment
|
ok to test |
|
thanks for revising this. Let's get rid of the |
2c59469 to
c4ffd05
Compare
|
ok to test |
2 similar comments
|
ok to test |
|
ok to test |
|
LGTM. Thanks, @d8tltanc. |
|
JDK14 failure seems like infra issue |
* 'trunk' of github.com:apache/kafka: (87 commits) KAFKA-9865: Expose output topic names from TopologyTestDriver (apache#8483) MINOR - Increase the number of Trogdor Histogram buckets to 10000 (apache#8627) KAFKA-9768: Fix handling of rest.advertised.listener config (apache#8360) KAFKA-9419: Fix possible integer overflow in CircularIterator (apache#7950) MINOR: Only add 'Data' suffix for generated request/response/header types (apache#8625) KAFKA-9947; Ensure proper shutdown of services in `TransactionsBounceTest` (apache#8602) KAFKA-6342; Remove unused workaround for JSON parsing of non-escaped strings (apache#8591) MINOR: Pass `-release 8` to scalac and upgrade to Gradle 6.4 (apache#8538) KAFKA-9946; Partition deletion event should only be sent if deletion was requested in the StopReplica request (apache#8609) MINOR: Improve TopologyTestDriver JavaDocs (apache#8619) MINOR: MockAdminClient should return InvalidReplicationFactorException if brokers.size < replicationFactor KAFKA-9748: Add Streams eos-beta integration test (apache#8496) KAFKA-9731: Disable immediate fetch response for hw propagation if replica selector is not defined (apache#8607) HOTFIX: set correct numIterations in shouldAllowConcurrentAccesses MINOR: Clean up some test dependencies on ConfigCommand and TopicCommand (apache#8527) KAFKA-9918; SslEngineFactory is NOT closed when channel is closing (apache#8551) KAFKA-9798: Send one round synchronously before starting the async producer (apache#8565) MINOR: Annotate KafkaAdminClientTest.testAlterClientQuotas() with @test KAFKA-9589: Enable testLogAppendTimeNonCompressedV2 and fix bug in helper method (apache#8533) MINOR: Use min/max function when possible (apache#8577) ... # Conflicts: # core/src/main/scala/kafka/log/Log.scala # gradle/dependencies.gradle # gradle/wrapper/gradle-wrapper.properties # gradlew
…and (apache#8527) Avoid calling into ConfigCommand and TopicCommand from tests that are not related to these commands. It's better to just invoke the admin APIs. Change a few cases where we were testing the deprecated --zookeeper flag to testing the --bootstrap-server flag instead. Unless we're explicitly testing the deprecated code path, we should be using the non-deprecated flags. Move testCreateWithUnspecifiedReplicationFactorAndPartitionsWithZkClient from TopicCommandWithAdminClientTest.scala into TopicCommandWithZKClientTest.scala, since it makes more sense in the latter. Reviewers: Colin P. McCabe <cmccabe@apache.org>
Committer Checklist (excluded from commit message)