Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve][functions] Missing assertion in KubernetesRuntimeTest::verifyJavaInstance #16747

Merged
merged 1 commit into from
Aug 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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