Skip to content
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-16791: Add thread detection to ClusterTestExtensions #16427

Closed
wants to merge 2 commits into from

Conversation

bboyleonp666
Copy link

TestUtils.verifyNoUnexpectedThreads() will verify there's no remaining threads that might affect the consequent test cases, which should be checked before and after all test cases.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@@ -170,12 +185,12 @@ public void testClusterTests() throws ExecutionException, InterruptedException {
@ClusterTest(types = {Type.ZK, Type.KRAFT, Type.CO_KRAFT}, disksPerBroker = 2),
})
public void testClusterTestWithDisksPerBroker() throws ExecutionException, InterruptedException {
Admin admin = clusterInstance.createAdminClient();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, all admins created by clusterInstance.createAdminClient are stored in a collection. They will get closed after tests, so we don't need to close they manually. I know that is a bit weird to IDE, but that is a style in code base so we can keep it as it is

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed. Thanks!

@chia7712
Copy link
Contributor

please fix the style error

@gharris1727
Copy link
Contributor

#15101 was the previous iteration of this, please see my concerns raised in that PR.

@chia7712
Copy link
Contributor

#15101 was the previous iteration of this, please see my concerns raised in that PR.

happy to know there was a PR for it. I read the comments, and it seems we can use BeforeEachCallback/AfterEachCallback to reduce the scope to the method-only enforcement. This solution works only for new test infra, but it should be fine as eventually we will be there. WDYT?

@gharris1727
Copy link
Contributor

This solution works only for new test infra, but it should be fine as eventually we will be there. WDYT?

This is actually a good thing, because I don't like the cascading failure property of verifyNoUnexpectedThreads, and I think it should be replaced with an alternative without that property. This is applying it in ~45 new places that may not have been affected by the cascading failure previously.

If this brings us closer to removing verifyNoUnexpectedThreads then i'm fine with it.

@chia7712
Copy link
Contributor

I have discussed with @bboyleonp666, and he has no bandwidth to address requests. Hence, I'm about to close this PR.

@chia7712 chia7712 closed this Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants