Skip to content

Commit

Permalink
Missing assertion in KubernetesRuntimeTest::verifyJavaInstance (apach…
Browse files Browse the repository at this point in the history
  • Loading branch information
cbornet authored and Technoboy- committed Aug 16, 2022
1 parent 2cc107d commit 7284795
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -401,12 +401,12 @@ private void verifyJavaInstance(InstanceConfig config, String depsDir, boolean s
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) {
Expand Down Expand Up @@ -437,8 +437,9 @@ private void verifyJavaInstance(InstanceConfig config, String depsDir, boolean s
+ " -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()
Expand All @@ -456,6 +457,7 @@ private void verifyJavaInstance(InstanceConfig config, String depsDir, boolean s
}
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", ""));
Expand Down

0 comments on commit 7284795

Please sign in to comment.