Skip to content

MINOR: Allow Block.resetBlockLatch to release blocked operation for end-of-test cleanup#14987

Closed
gharris1727 wants to merge 1 commit intoapache:trunkfrom
gharris1727:minor-graceful-blocking-cleanup
Closed

MINOR: Allow Block.resetBlockLatch to release blocked operation for end-of-test cleanup#14987
gharris1727 wants to merge 1 commit intoapache:trunkfrom
gharris1727:minor-graceful-blocking-cleanup

Conversation

@gharris1727
Copy link
Contributor

The kafka.utils.TestUtils.verifyNoUnexpectedThreads method used before and after core tests finds threads leaked by these tests. If these tests run before core tests, then those tests will all fail this assertion.

Instead of leaving the blocked connectors blocking indefinitely, they should block just long enough for the test to verify the desired behavior. After the test is complete, the test should signal to the blocked connector to exit the block and return control to the framework, which can then do it's cancellation operations.

In the future we can augment the tests to verify the behavior of the thread after cancellation by triggering the reset before the end of the test.

Committer Checklist (excluded from commit message)

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

…est cleanup

Signed-off-by: Greg Harris <greg.harris@aiven.io>
blockLatch.countDown();
}
blockLatch = new CountDownLatch(1);
clearLatch = new CountDownLatch(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @gharris1727 - I had a question regarding lines 410 to 412.

When is it used and do we need to do the same for clearLatch ?

@C0urante
Copy link
Contributor

I believe this is also addressed in #12290?

@gharris1727
Copy link
Contributor Author

Closing in favor of #12290

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants