-
Notifications
You must be signed in to change notification settings - Fork 14.5k
MINOR: Migrate EligibleLeaderReplicasIntegrationTestto use new test infra #20199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
MINOR: Migrate EligibleLeaderReplicasIntegrationTestto use new test infra #20199
Conversation
…ScalaBuffer with CollectionConverters.asScala
…ibleLeaderReplicasIntegrationTest
…ibleLeaderReplicasIntegrationTest
…ibleLeaderReplicasIntegrationTest
…import-control-server.xml, and fix the bug in restartDeadBrokers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jim0987795064 thanks for this patch. a couple of comments remain. PTAL
checkstyle/import-control-server.xml
Outdated
|
||
<!-- no one depends on the server --> | ||
<disallow pkg="kafka" /> | ||
<allow pkg="scala" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use var
to avoid importing those dependencies explicitly
killBroker(initialReplicas.get(0).id()); | ||
killBroker(initialReplicas.get(1).id()); | ||
clusterInstance.shutdownBroker(initialReplicas.get(0).id()); | ||
clusterInstance.shutdownBroker(initialReplicas.get(1).id()); | ||
|
||
waitForIsrAndElr((isrSize, elrSize) -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waitForIsrAndElr((isrSize, elrSize) -> isrSize == 0 && elrSize == 3);
return b.config().brokerId() == brokerToBeUncleanShutdown; | ||
}).get(); | ||
KafkaBroker broker = clusterInstance.brokers().values().stream().filter(b -> b.config().brokerId() == brokerToBeUncleanShutdown) | ||
.findFirst().get(); | ||
Seq<File> dirs = broker.logManager().liveLogDirs(); | ||
assertEquals(1, dirs.size()); | ||
CleanShutdownFileHandler handler = new CleanShutdownFileHandler(dirs.apply(0).toString()); | ||
assertTrue(handler.exists()); | ||
assertDoesNotThrow(() -> handler.delete()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertDoesNotThrow(handler::delete);
throw new IllegalArgumentException("Must supply at least one server config."); | ||
} | ||
brokers().entrySet().forEach(entry -> { | ||
if (!entry.getValue().isShutdown()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems the method is used to restart "dead" brokers, so the condition should be if (entry.getValue().isShutdown())
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback. I've addressed issues mentioned above.
Changes: Use ClusterTest to rewrite EligibleLeaderReplicasIntegrationTest.