Skip to content

Commit

Permalink
[Tests] Limit Pulsar Functions Java runtime to 128MB of RAM in integr…
Browse files Browse the repository at this point in the history
…ation tests (apache#10567)
  • Loading branch information
lhotari authored May 13, 2021
1 parent 1926dee commit 61dc9e3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
@Setter
@ToString
public class CommandGenerator {
private static final long MB = 1048576L;
private static final long JAVA_RUNTIME_RAM_BYTES = 128 * MB;

public enum Runtime {
JAVA,
PYTHON,
Expand Down Expand Up @@ -119,7 +122,6 @@ public String generateLocalRunCommand(String codeFile) {
}
break;
}

return commandBuilder.toString();
}

Expand Down Expand Up @@ -192,6 +194,7 @@ public String generateCreateFunctionCommand(String codeFile) {
switch (runtime){
case JAVA:
commandBuilder.append(" --jar " + JAVAJAR);
commandBuilder.append(" --ram " + JAVA_RUNTIME_RAM_BYTES);
break;
case PYTHON:
if (codeFile != null) {
Expand Down Expand Up @@ -281,6 +284,7 @@ public String generateUpdateFunctionCommand(String codeFile) {
switch (runtime) {
case JAVA:
commandBuilder.append(" --jar " + JAVAJAR);
commandBuilder.append(" --ram " + JAVA_RUNTIME_RAM_BYTES);
break;
case PYTHON:
if (codeFile != null) {
Expand Down

0 comments on commit 61dc9e3

Please sign in to comment.