Skip to content

Commit

Permalink
[Build] Make the test JVM exit if OOME occurs (#14509)
Browse files Browse the repository at this point in the history
- OOMEs can make the build to take very long to complete.
  It's better to fail fast in tests when OOMEs occur.
  • Loading branch information
lhotari authored Mar 1, 2022
1 parent 8ec2954 commit 89a36f9
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@ flexible messaging model and an intuitive client API.</description>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${testJacocoAgentArgument} -Xmx1G -XX:+UseG1GC
<argLine>${testJacocoAgentArgument} -XX:+ExitOnOutOfMemoryError -Xmx1G -XX:+UseG1GC
-Dpulsar.allocator.pooled=true
-Dpulsar.allocator.leak_detection=Advanced
-Dpulsar.allocator.exit_on_oom=false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ public long getLastSeqId() {
}
}

@Test(timeOut = 300000, groups = "quarantine")
// TODO: Test disabled since it results in a OOME
@Test(timeOut = 300000, groups = "quarantine", enabled = false)
public void testClientDeduplicationCorrectnessWithFailure() throws Exception {
final String namespacePortion = "dedup";
final String replNamespace = tenant + "/" + namespacePortion;
Expand Down
2 changes: 1 addition & 1 deletion tests/bc_2_0_0/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${testJacocoAgentArgument} -Xmx2G -XX:MaxDirectMemorySize=8G
<argLine>${testJacocoAgentArgument} -XX:+ExitOnOutOfMemoryError -Xmx2G -XX:MaxDirectMemorySize=8G
-Dio.netty.leakDetectionLevel=advanced
${test.additional.args}
</argLine>
Expand Down
2 changes: 1 addition & 1 deletion tests/bc_2_0_1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${testJacocoAgentArgument} -Xmx2G -XX:MaxDirectMemorySize=8G
<argLine>${testJacocoAgentArgument} -XX:+ExitOnOutOfMemoryError -Xmx2G -XX:MaxDirectMemorySize=8G
-Dio.netty.leakDetectionLevel=advanced
${test.additional.args}
</argLine>
Expand Down
2 changes: 1 addition & 1 deletion tests/bc_2_6_0/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${testJacocoAgentArgument} -Xmx2G -XX:MaxDirectMemorySize=8G
<argLine>${testJacocoAgentArgument} -XX:+ExitOnOutOfMemoryError -Xmx2G -XX:MaxDirectMemorySize=8G
-Dio.netty.leakDetectionLevel=advanced
${test.additional.args}
</argLine>
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${testJacocoAgentArgument} -Xmx1G -XX:MaxDirectMemorySize=1G
<argLine>${testJacocoAgentArgument} -XX:+ExitOnOutOfMemoryError -Xmx1G -XX:MaxDirectMemorySize=1G
-Dio.netty.leakDetectionLevel=advanced
${test.additional.args}
</argLine>
Expand Down
2 changes: 1 addition & 1 deletion tests/pulsar-client-admin-shade-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${testJacocoAgentArgument} -Xmx2G -XX:MaxDirectMemorySize=8G
<argLine>${testJacocoAgentArgument} -XX:+ExitOnOutOfMemoryError -Xmx2G -XX:MaxDirectMemorySize=8G
-Dio.netty.leakDetectionLevel=advanced
${test.additional.args}
</argLine>
Expand Down
2 changes: 1 addition & 1 deletion tests/pulsar-client-all-shade-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${testJacocoAgentArgument} -Xmx2G -XX:MaxDirectMemorySize=8G
<argLine>${testJacocoAgentArgument} -XX:+ExitOnOutOfMemoryError -Xmx2G -XX:MaxDirectMemorySize=8G
-Dio.netty.leakDetectionLevel=advanced
${test.additional.args}
</argLine>
Expand Down
2 changes: 1 addition & 1 deletion tests/pulsar-client-shade-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${testJacocoAgentArgument} -Xmx2G -XX:MaxDirectMemorySize=8G
<argLine>${testJacocoAgentArgument} -XX:+ExitOnOutOfMemoryError -Xmx2G -XX:MaxDirectMemorySize=8G
-Dio.netty.leakDetectionLevel=advanced
${test.additional.args}
</argLine>
Expand Down

0 comments on commit 89a36f9

Please sign in to comment.