testclient: add regression test for LoadSimulationController executor…#25156
testclient: add regression test for LoadSimulationController executor…#25156ChimdumebiNebolisa wants to merge 11 commits intoapache:masterfrom
Conversation
|
@ChimdumebiNebolisa Please add the following content to your PR description and select a checkbox: |
66767ce to
3cc3d5a
Compare
pulsar-testclient/src/main/java/org/apache/pulsar/testclient/LoadSimulationController.java
Outdated
Show resolved
Hide resolved
pulsar-testclient/src/main/java/org/apache/pulsar/testclient/LoadSimulationController.java
Outdated
Show resolved
Hide resolved
pulsar-testclient/src/test/java/org/apache/pulsar/testclient/LoadSimulationControllerTest.java
Outdated
Show resolved
Hide resolved
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.assertTrue; |
There was a problem hiding this comment.
In Pulsar, we use TestNG instead of Junit 5. Please use TestNG imports instead.
There was a problem hiding this comment.
Please ensure that CI passes in "Personal CI". The instructions for setting this up are at https://pulsar.apache.org/contribute/personal-ci/.
|
|
||
| import static org.apache.pulsar.broker.resources.LoadBalanceResources.BUNDLE_DATA_BASE_PATH; | ||
| import static org.apache.pulsar.broker.resources.LoadBalanceResources.RESOURCE_QUOTA_BASE_PATH; | ||
|
|
There was a problem hiding this comment.
The Pulsar code style doesn't contain an empty line between static imports. Please see https://pulsar.apache.org/contribute/setup-ide/#configure-code-style how to setup IntelliJ code style if you happen to use IntelliJ.
You can quickly run checkstyle from the command line with this command:
mvn initialize checkstyle:check|
@ChimdumebiNebolisa Please ensure that CI passes in "Personal CI". The instructions for setting this up are at https://pulsar.apache.org/contribute/personal-ci/. There are a lot of flaky tests and if there are unrelated test failures, you can re-run failed tests. |
|
@lhotari I ran Personal CI on my fork for this PR branch.
These links are the GitHub Actions workflow run pages (logs/artifacts are accessible from the run summary under each job). Given that the upstream PR currently shows workflows “awaiting approval”; maybe the pending workflow runs could be approved so required status checks can report? |
What does this PR do?
Fixes an executor thread leak in
LoadSimulationControllerand adds/updates tests to prevent regressions.Why is this needed?
LoadSimulationControllerpreviously used a cachedExecutorServicewithout a shutdown path, which can leave non-daemon threads running and delay or prevent clean JVM shutdown in embedded or containerized test environments.What changed?
AutoCloseableand added aclose()method that shuts down the executor safely.finallyinrun().close().How was this tested?
Updated JUnit 5 test creates a controller instance, forces executor thread creation, calls
close(), and verifies the executor threads terminate.Docs
docdoc-requireddoc-not-neededdoc-complete