You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by te...@apache.org on 2022/08/11 12:48:16 UTC
[pulsar] branch master updated: [fix][test] Stop worker services when tearing down PulsarFunctionTlsTest. (#17054)
This is an automated email from the ASF dual-hosted git repository.
technoboy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 6ae2876786b [fix][test] Stop worker services when tearing down PulsarFunctionTlsTest. (#17054)
6ae2876786b is described below
commit 6ae2876786ba6ba97f51fdf097c63001b8b7daab
Author: Zike Yang <zi...@apache.org>
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();
}