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/03 11:14:59 UTC

[pulsar] branch master updated: Missing assertion in KubernetesRuntimeTest::verifyJavaInstance (#16747)

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 5c8c86dc7c8 Missing assertion in KubernetesRuntimeTest::verifyJavaInstance (#16747)
5c8c86dc7c8 is described below

commit 5c8c86dc7c8ef418a69e66fc65b235620f3e8ed8
Author: Christophe Bornet <cb...@hotmail.com>
AuthorDate: Wed Aug 3 13:14:52 2022 +0200

    Missing assertion in KubernetesRuntimeTest::verifyJavaInstance (#16747)
---
 .../functions/runtime/kubernetes/KubernetesRuntimeTest.java  | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/pulsar-functions/runtime/src/test/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntimeTest.java b/pulsar-functions/runtime/src/test/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntimeTest.java
index f9a5521b2df..18fbe2e5160 100644
--- a/pulsar-functions/runtime/src/test/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntimeTest.java
+++ b/pulsar-functions/runtime/src/test/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntimeTest.java
@@ -401,12 +401,12 @@ public class KubernetesRuntimeTest {
             extraDepsEnv = " -Dpulsar.functions.extra.dependencies.dir=" + depsDir;
             classpath = classpath + ":" + depsDir + "/*";
             totalArgs = 42;
-            portArg = 28;
-            metricsPortArg = 30;
+            portArg = 29;
+            metricsPortArg = 31;
         } else {
             extraDepsEnv = "";
-            portArg = 27;
-            metricsPortArg = 29;
+            portArg = 28;
+            metricsPortArg = 30;
             totalArgs = 41;
         }
         if (secretsAttached) {
@@ -437,8 +437,9 @@ public class KubernetesRuntimeTest {
                 + " -Dlog4j.configurationFile=kubernetes_instance_log4j2.xml "
                 + "-Dpulsar.function.log.dir=" + logDirectory + "/" + FunctionCommon.getFullyQualifiedName(config.getFunctionDetails())
                 + " -Dpulsar.function.log.file=" + config.getFunctionDetails().getName() + "-$SHARD_ID"
-                + " -Dio.netty.tryReflectionSetAccessible=true -Xmx" + String.valueOf(RESOURCES.getRam())
+                + " -Dio.netty.tryReflectionSetAccessible=true"
                 + " --add-opens java.base/sun.net=ALL-UNNAMED"
+                + " -Xmx" + RESOURCES.getRam()
                 + " org.apache.pulsar.functions.instance.JavaInstanceMain"
                 + " --jar " + jarLocation + " --instance_id "
                 + "$SHARD_ID" + " --function_id " + config.getFunctionId()
@@ -456,6 +457,7 @@ public class KubernetesRuntimeTest {
         }
         expectedArgs += " --cluster_name standalone --nar_extraction_directory " + narExtractionDirectory;
 
+        assertEquals(String.join(" ", args), expectedArgs);
 
         // check padding and xmx
         long heap = Long.parseLong(args.stream().filter(s -> s.startsWith("-Xmx")).collect(Collectors.toList()).get(0).replace("-Xmx", ""));