This is an automated email from the ASF dual-hosted git repository. technoboy pushed a commit to branch branch-2.11 in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 3529547c00bc6a4d96f25d87db5ea7bddfc0f7f1 Author: Zike Yang <[email protected]> AuthorDate: Thu Aug 11 20:48:09 2022 +0800 [fix][test] Stop worker services when tearing down PulsarFunctionTlsTest. (#17054) --- .../org/apache/pulsar/functions/worker/PulsarFunctionTlsTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/functions/worker/PulsarFunctionTlsTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/functions/worker/PulsarFunctionTlsTest.java index a58a6494d2b..e7c6dddc9b2 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/functions/worker/PulsarFunctionTlsTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/functions/worker/PulsarFunctionTlsTest.java @@ -71,6 +71,7 @@ public class PulsarFunctionTlsTest { protected PulsarService[] pulsarServices = new PulsarService[BROKER_COUNT]; protected PulsarService leaderPulsar; protected PulsarAdmin leaderAdmin; + protected WorkerService[] fnWorkerServices = new WorkerService[BROKER_COUNT]; protected String testCluster = "my-cluster"; protected String testTenant = "my-tenant"; protected String testNamespace = testTenant + "/my-ns"; @@ -137,12 +138,12 @@ public class PulsarFunctionTlsTest { workerConfig.setBrokerClientAuthenticationEnabled(true); workerConfig.setTlsEnabled(true); workerConfig.setUseTls(true); - WorkerService fnWorkerService = WorkerServiceLoader.load(workerConfig); + fnWorkerServices[i] = WorkerServiceLoader.load(workerConfig); configurations[i] = config; pulsarServices[i] = new PulsarService( - config, workerConfig, Optional.of(fnWorkerService), code -> {}); + config, workerConfig, Optional.of(fnWorkerServices[i]), code -> {}); pulsarServices[i].start(); // Sleep until pulsarServices[0] becomes leader, this way we can spy namespace bundle assignment easily. @@ -181,6 +182,9 @@ public class PulsarFunctionTlsTest { if (pulsarAdmins[i] != null) { pulsarAdmins[i].close(); } + if (fnWorkerServices[i] != null) { + fnWorkerServices[i].stop(); + } if (pulsarServices[i] != null) { pulsarServices[i].close(); }
