-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
KAFKA-17574: Allow overriding TestKitNodes baseDirectory #17225
Conversation
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.
@srdo thanks for your patch. please take a look at following comments. thanks
cluster.nodes().brokerNodes().values().forEach(broker -> { | ||
assertTrue(Paths.get(broker.metadataDirectory()).startsWith(baseDirectory)); | ||
}); | ||
} catch (Exception e) { |
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 is find to throw exception directly so could you please remove the catch?
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.
Sure, this was copied from the test above. Would you prefer I also remove it there?
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.
yes, please do a bit refactor :)
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.
👍 Comments should have been addressed in the latest commit
setCombined(true). | ||
setNumControllerNodes(1).build()).build()) { | ||
assertEquals(cluster.nodes().baseDirectory(), baseDirectory.toFile().getAbsolutePath()); | ||
cluster.nodes().controllerNodes().values().forEach(controller -> { |
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 remove unnecessary {}
cluster.nodes().controllerNodes().values().forEach(controller -> { | ||
assertTrue(Paths.get(controller.metadataDirectory()).startsWith(baseDirectory)); | ||
}); | ||
cluster.nodes().brokerNodes().values().forEach(broker -> { |
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 remove unnecessary {}
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.
Will do
@srdo Could you please sync trunk? |
@chia7712 Sure, squashed and rebased to latest. |
@srdo sorry that we have a big refactor for the code. Could you please fix the conflicts again? |
@chia7712 Sure, done |
@srdo sorry that could you please fix the conflicts again? |
06e5ee0
to
d38ad47
Compare
@chia7712 done |
@srdo could you please rebase code to trigger CI again? |
I feel the failed tests are unrelated. |
This allows shutting down a KafkaClusterTestKit from a JVM shutdown hook without risking error logs because the base directory has already been deleted by the shutdown hook TestUtils.tempDirectory sets up.
@chia7712 Sure, done. FWIW ShareConsumerTest passes for me locally. |
This allows shutting down a KafkaClusterTestKit from a JVM shutdown hook without risking error logs because the base directory has already been deleted by the shutdown hook TestUtils.tempDirectory sets up. Reviewers: Chia-Ping Tsai <[email protected]>
This allows shutting down a KafkaClusterTestKit from a JVM shutdown hook without risking error logs because the base directory has already been deleted by the shutdown hook TestUtils.tempDirectory sets up. Reviewers: Chia-Ping Tsai <[email protected]>
This allows shutting down a KafkaClusterTestKit from a JVM shutdown hook without risking error logs because the base directory has already been deleted by the shutdown hook TestUtils.tempDirectory sets up. Reviewers: Chia-Ping Tsai <[email protected]>
This allows shutting down a KafkaClusterTestKit from a JVM shutdown hook without risking error logs because the base directory has already been deleted by the shutdown hook TestUtils.tempDirectory sets up.
Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.
Added a test that uses the new method and asserts that the controller and broker metadata directories are inside the specified directory.
Committer Checklist (excluded from commit message)