This is an automated email from the ASF dual-hosted git repository.

sijie 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 af213c2  [Tests] Reduce integration test memory usage in CI (#11414)
af213c2 is described below

commit af213c23954f465d289e7cc0bf8e6da010f05a46
Author: Lari Hotari <[email protected]>
AuthorDate: Thu Jul 22 03:37:10 2021 +0300

    [Tests] Reduce integration test memory usage in CI (#11414)
    
    ### Motivation
    
    There are several integration test jobs failing where the docker container 
run by Testcontainers gets terminated with error code 137 (maps to out of 
memory error).
    
    The failing jobs are:
    CI - Integration - Sql - 
https://github.com/apache/pulsar/actions/workflows/ci-integration-sql.yaml 
(most fail)
    CI - Integration - Process - 
https://github.com/apache/pulsar/actions/workflows/ci-integration-process.yaml 
(some succeed)
    CI - Integration - Messaging - 
https://github.com/apache/pulsar/actions/workflows/ci-integration-messaging.yaml
 (some succeed)
    CI - Integration - Function & IO - 
https://github.com/apache/pulsar/actions/workflows/ci-integration-function.yaml 
(some succeed)
    
    This started happening yesterday for most PR builds.
    
    For example:
    
https://github.com/apache/pulsar/runs/3111868662?check_suite_focus=true#step:14:1024
    
    ```
    Error:  Tests run: 22, Failures: 1, Errors: 0, Skipped: 21, Time elapsed: 
292.035 s <<< FAILURE! - in TestSuite
    Error:  
testPythonWordCountFunction(org.apache.pulsar.tests.integration.functions.PulsarStateTest)
  Time elapsed: 43.416 s  <<< FAILURE!
    org.apache.pulsar.tests.integration.docker.ContainerExecException: 
/pulsar/bin/pulsar-admin functions querystate --tenant public --namespace 
default --name test-wordcount-py-fn-tfhycxsf --key message-1 failed on 
705ecb067214d1cc42cd16358df6fa6d7a8cacc6c5ddd0cdde84a73b3e2e1f76 with error 
code 137
    at 
org.apache.pulsar.tests.integration.utils.DockerUtils$2.onComplete(DockerUtils.java:248)
    at 
org.testcontainers.shaded.com.github.dockerjava.core.exec.AbstrAsyncDockerCmdExec$1.onComplete(AbstrAsyncDockerCmdExec.java:51)
    at 
org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.lambda$executeAndStream$1(DefaultInvocationBuilder.java:276)
    at java.base/java.lang.Thread.run(Thread.java:829)
    ```
    
    It seems that GitHub Actions Runner VM has increased memory consumption 
after[ the most recent 
updates](https://github.com/actions/virtual-environments/blob/releases/ubuntu20/20210718/images/linux/Ubuntu2004-README.md).
    
    ### Modifications
    
    - Reduce Presto maximum heap size in integration tests
    - Reduce standalone container memory usage
    - Stop some system services to save RAM
    - Redcue memory usage of the integration tests surefire JVM
---
 .github/actions/tune-runner-vm/action.yml          | 25 +++++++++++++++++-
 .github/workflows/ci-cpp.yaml                      |  4 +--
 .../ci-integration-backwards-compatibility.yaml    |  5 ++--
 .github/workflows/ci-integration-cli.yaml          |  3 +--
 .github/workflows/ci-integration-function.yaml     |  5 ++--
 .github/workflows/ci-integration-messaging.yaml    |  5 ++--
 .github/workflows/ci-integration-process.yaml      | 10 +++++---
 .github/workflows/ci-integration-schema.yaml       |  5 ++--
 .github/workflows/ci-integration-sql.yaml          | 13 +++++++---
 .github/workflows/ci-integration-standalone.yaml   |  5 ++--
 .github/workflows/ci-integration-thread.yaml       |  5 ++--
 .../ci-integration-tiered-filesystem.yaml          |  5 ++--
 .../workflows/ci-integration-tiered-jcloud.yaml    |  5 ++--
 .github/workflows/ci-integration-transaction.yaml  |  5 ++--
 .github/workflows/ci-pulsar-website-build.yaml     |  5 ++--
 .github/workflows/ci-shade-test.yaml               |  3 +--
 .../docker-images/latest-version-image/Dockerfile  |  2 ++
 .../latest-version-image/conf/presto/jvm.config    | 30 ++++++++++++++++++++++
 tests/integration/pom.xml                          |  2 +-
 .../integration/containers/ChaosContainer.java     |  6 +++++
 .../integration/containers/PulsarContainer.java    |  1 +
 .../containers/StandaloneContainer.java            |  1 +
 22 files changed, 104 insertions(+), 46 deletions(-)

diff --git a/.github/actions/tune-runner-vm/action.yml 
b/.github/actions/tune-runner-vm/action.yml
index ec5599a..30cf183 100644
--- a/.github/actions/tune-runner-vm/action.yml
+++ b/.github/actions/tune-runner-vm/action.yml
@@ -32,6 +32,10 @@ runs:
             # consumption is high.
             # Set vm.swappiness=1 to avoid swapping and allow high RAM usage
             echo 1 | sudo tee /proc/sys/vm/swappiness
+            # Set swappiness to 1 for all cgroups and sub-groups
+            for swappiness_file in /sys/fs/cgroup/memory/*/memory.swappiness 
/sys/fs/cgroup/memory/*/*/memory.swappiness; do
+              echo 1 | sudo tee $swappiness_file > /dev/null
+            done
 
             # use "madvise" Linux Transparent HugePages (THP) setting
             # 
https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html
@@ -53,5 +57,24 @@ runs:
             sudo systemctl stop fstrim.timer || true
             sudo systemctl disable fstrim.service || true
             sudo systemctl stop fstrim.service || true
+
+            # stop php-fpm
+            sudo systemctl stop php8.0-fpm.service || true
+            sudo systemctl stop php7.4-fpm.service || true
+            # stop mono-xsp4
+            sudo systemctl disable mono-xsp4.service || true
+            sudo systemctl stop mono-xsp4.service || true
+            sudo killall mono || true
+
+            # stop Azure Linux agent to save RAM
+            sudo systemctl stop walinuxagent.service || true
+
+            # show memory
+            free -m
+            # show disk
+            df -h
+            # show cggroup
+            echo "/actions_job cgroup settings:"
+            sudo cgget actions_job
         fi
-      shell: bash
\ No newline at end of file
+      shell: bash
diff --git a/.github/workflows/ci-cpp.yaml b/.github/workflows/ci-cpp.yaml
index 43da692..94d1210 100644
--- a/.github/workflows/ci-cpp.yaml
+++ b/.github/workflows/ci-cpp.yaml
@@ -74,8 +74,6 @@ jobs:
       - name: clean disk
         if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
         run: |
-          sudo swapoff -a
-          sudo rm -f /swapfile
           sudo apt clean
           docker rmi $(docker images -q) -f
           df -h
@@ -105,4 +103,4 @@ jobs:
         continue-on-error: true
         with:
           name: test-logs
-          path: test-logs
\ No newline at end of file
+          path: test-logs
diff --git a/.github/workflows/ci-integration-backwards-compatibility.yaml 
b/.github/workflows/ci-integration-backwards-compatibility.yaml
index 707d88e..ea9dc0d 100644
--- a/.github/workflows/ci-integration-backwards-compatibility.yaml
+++ b/.github/workflows/ci-integration-backwards-compatibility.yaml
@@ -79,8 +79,7 @@ jobs:
       - name: clean disk
         if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
         run: |
-          sudo swapoff -a
-          sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android 
/opt/ghc
+          sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
           sudo apt clean
           docker rmi $(docker images -q) -f
           df -h
@@ -119,4 +118,4 @@ jobs:
         continue-on-error: true
         with:
           name: surefire-reports
-          path: tests/integration/target/surefire-reports
\ No newline at end of file
+          path: tests/integration/target/surefire-reports
diff --git a/.github/workflows/ci-integration-cli.yaml 
b/.github/workflows/ci-integration-cli.yaml
index 8f198a1..47af7d1 100644
--- a/.github/workflows/ci-integration-cli.yaml
+++ b/.github/workflows/ci-integration-cli.yaml
@@ -79,8 +79,7 @@ jobs:
       - name: clean disk
         if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
         run: |
-          sudo swapoff -a
-          sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android 
/opt/ghc
+          sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
           sudo apt clean
           docker rmi $(docker images -q) -f
           df -h
diff --git a/.github/workflows/ci-integration-function.yaml 
b/.github/workflows/ci-integration-function.yaml
index b1af22d..c4f9e07 100644
--- a/.github/workflows/ci-integration-function.yaml
+++ b/.github/workflows/ci-integration-function.yaml
@@ -79,8 +79,7 @@ jobs:
       - name: clean disk
         if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
         run: |
-          sudo swapoff -a
-          sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android 
/opt/ghc
+          sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
           sudo apt clean
           docker rmi $(docker images -q) -f
           df -h
@@ -119,4 +118,4 @@ jobs:
         continue-on-error: true
         with:
           name: surefire-reports
-          path: tests/integration/target/surefire-reports
\ No newline at end of file
+          path: tests/integration/target/surefire-reports
diff --git a/.github/workflows/ci-integration-messaging.yaml 
b/.github/workflows/ci-integration-messaging.yaml
index 2cea626..00e615b 100644
--- a/.github/workflows/ci-integration-messaging.yaml
+++ b/.github/workflows/ci-integration-messaging.yaml
@@ -79,8 +79,7 @@ jobs:
       - name: clean disk
         if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
         run: |
-          sudo swapoff -a
-          sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android 
/opt/ghc
+          sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
           sudo apt clean
           docker rmi $(docker images -q) -f
           df -h
@@ -119,4 +118,4 @@ jobs:
         continue-on-error: true
         with:
           name: surefire-reports
-          path: tests/integration/target/surefire-reports
\ No newline at end of file
+          path: tests/integration/target/surefire-reports
diff --git a/.github/workflows/ci-integration-process.yaml 
b/.github/workflows/ci-integration-process.yaml
index e88f1b6..404ce7a 100644
--- a/.github/workflows/ci-integration-process.yaml
+++ b/.github/workflows/ci-integration-process.yaml
@@ -78,8 +78,7 @@ jobs:
       - name: clean disk
         if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
         run: |
-          sudo swapoff -a
-          sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android 
/opt/ghc
+          sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
           sudo apt clean
           docker rmi $(docker images -q) -f
           df -h
@@ -104,6 +103,11 @@ jobs:
         if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
         run: ./build/run_integration_group.sh PULSAR_CONNECTORS_PROCESS
 
+      - name: Log dmesg when failed
+        if: ${{ failure() }}
+        continue-on-error: true
+        run: sudo dmesg
+
       - name: Upload container logs
         uses: actions/upload-artifact@v2
         if: ${{ cancelled() || failure() }}
@@ -118,4 +122,4 @@ jobs:
         continue-on-error: true
         with:
           name: surefire-reports
-          path: tests/integration/target/surefire-reports
\ No newline at end of file
+          path: tests/integration/target/surefire-reports
diff --git a/.github/workflows/ci-integration-schema.yaml 
b/.github/workflows/ci-integration-schema.yaml
index d8c8859..571d22a 100644
--- a/.github/workflows/ci-integration-schema.yaml
+++ b/.github/workflows/ci-integration-schema.yaml
@@ -78,8 +78,7 @@ jobs:
       - name: clean disk
         if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
         run: |
-          sudo swapoff -a
-          sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android 
/opt/ghc
+          sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
           sudo apt clean
           docker rmi $(docker images -q) -f
           df -h
@@ -115,4 +114,4 @@ jobs:
         continue-on-error: true
         with:
           name: surefire-reports
-          path: tests/integration/target/surefire-reports
\ No newline at end of file
+          path: tests/integration/target/surefire-reports
diff --git a/.github/workflows/ci-integration-sql.yaml 
b/.github/workflows/ci-integration-sql.yaml
index c3a324e..74951e3 100644
--- a/.github/workflows/ci-integration-sql.yaml
+++ b/.github/workflows/ci-integration-sql.yaml
@@ -27,7 +27,8 @@ on:
       - branch-*
 
 env:
-  MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false 
-Dmaven.wagon.http.retryHandler.class=standard 
-Dmaven.wagon.http.retryHandler.count=3
+  MAVEN_OPTS: -Xmx768m -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false 
-Dmaven.wagon.http.retryHandler.class=standard 
-Dmaven.wagon.http.retryHandler.count=3
+  MALLOC_ARENA_MAX: "1"
 
 jobs:
 
@@ -78,8 +79,7 @@ jobs:
       - name: clean disk
         if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
         run: |
-          sudo swapoff -a
-          sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android 
/opt/ghc
+          sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
           sudo apt clean
           docker rmi $(docker images -q) -f
           df -h
@@ -104,6 +104,11 @@ jobs:
         if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
         run: ./build/run_integration_group.sh SQL
 
+      - name: Log dmesg when failed
+        if: ${{ failure() }}
+        continue-on-error: true
+        run: sudo dmesg
+
       - name: Upload container logs
         uses: actions/upload-artifact@v2
         if: ${{ cancelled() || failure() }}
@@ -118,4 +123,4 @@ jobs:
         continue-on-error: true
         with:
           name: surefire-reports
-          path: tests/integration/target/surefire-reports
\ No newline at end of file
+          path: tests/integration/target/surefire-reports
diff --git a/.github/workflows/ci-integration-standalone.yaml 
b/.github/workflows/ci-integration-standalone.yaml
index 6266746..19b8bfd 100644
--- a/.github/workflows/ci-integration-standalone.yaml
+++ b/.github/workflows/ci-integration-standalone.yaml
@@ -78,8 +78,7 @@ jobs:
       - name: clean disk
         if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
         run: |
-          sudo swapoff -a
-          sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android 
/opt/ghc
+          sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
           sudo apt clean
           docker rmi $(docker images -q) -f
           df -h
@@ -118,4 +117,4 @@ jobs:
         continue-on-error: true
         with:
           name: surefire-reports
-          path: tests/integration/target/surefire-reports
\ No newline at end of file
+          path: tests/integration/target/surefire-reports
diff --git a/.github/workflows/ci-integration-thread.yaml 
b/.github/workflows/ci-integration-thread.yaml
index 24099fb..cd22c84 100644
--- a/.github/workflows/ci-integration-thread.yaml
+++ b/.github/workflows/ci-integration-thread.yaml
@@ -78,8 +78,7 @@ jobs:
       - name: clean disk
         if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
         run: |
-          sudo swapoff -a
-          sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android 
/opt/ghc
+          sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
           sudo apt clean
           docker rmi $(docker images -q) -f
           df -h
@@ -118,4 +117,4 @@ jobs:
         continue-on-error: true
         with:
           name: surefire-reports
-          path: tests/integration/target/surefire-reports
\ No newline at end of file
+          path: tests/integration/target/surefire-reports
diff --git a/.github/workflows/ci-integration-tiered-filesystem.yaml 
b/.github/workflows/ci-integration-tiered-filesystem.yaml
index b1c6ba9..3ae4fca 100644
--- a/.github/workflows/ci-integration-tiered-filesystem.yaml
+++ b/.github/workflows/ci-integration-tiered-filesystem.yaml
@@ -78,8 +78,7 @@ jobs:
       - name: clean disk
         if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
         run: |
-          sudo swapoff -a
-          sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android 
/opt/ghc
+          sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
           sudo apt clean
           docker rmi $(docker images -q) -f
           df -h
@@ -118,4 +117,4 @@ jobs:
         continue-on-error: true
         with:
           name: surefire-reports
-          path: tests/integration/target/surefire-reports
\ No newline at end of file
+          path: tests/integration/target/surefire-reports
diff --git a/.github/workflows/ci-integration-tiered-jcloud.yaml 
b/.github/workflows/ci-integration-tiered-jcloud.yaml
index 5ad078f..2f3dc3e 100644
--- a/.github/workflows/ci-integration-tiered-jcloud.yaml
+++ b/.github/workflows/ci-integration-tiered-jcloud.yaml
@@ -78,8 +78,7 @@ jobs:
       - name: clean disk
         if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
         run: |
-          sudo swapoff -a
-          sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android 
/opt/ghc
+          sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
           sudo apt clean
           docker rmi $(docker images -q) -f
           df -h
@@ -118,4 +117,4 @@ jobs:
         continue-on-error: true
         with:
           name: surefire-reports
-          path: tests/integration/target/surefire-reports
\ No newline at end of file
+          path: tests/integration/target/surefire-reports
diff --git a/.github/workflows/ci-integration-transaction.yaml 
b/.github/workflows/ci-integration-transaction.yaml
index 30929b4..b53814e 100644
--- a/.github/workflows/ci-integration-transaction.yaml
+++ b/.github/workflows/ci-integration-transaction.yaml
@@ -78,8 +78,7 @@ jobs:
       - name: clean disk
         if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
         run: |
-          sudo swapoff -a
-          sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android 
/opt/ghc
+          sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
           sudo apt clean
           docker rmi $(docker images -q) -f
           df -h
@@ -115,4 +114,4 @@ jobs:
         continue-on-error: true
         with:
           name: surefire-reports
-          path: tests/integration/target/surefire-reports
\ No newline at end of file
+          path: tests/integration/target/surefire-reports
diff --git a/.github/workflows/ci-pulsar-website-build.yaml 
b/.github/workflows/ci-pulsar-website-build.yaml
index f9a1f28..a6b196e 100644
--- a/.github/workflows/ci-pulsar-website-build.yaml
+++ b/.github/workflows/ci-pulsar-website-build.yaml
@@ -61,8 +61,7 @@ jobs:
 
       - name: clean disk
         run: |
-          sudo swapoff -a
-          sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android 
/opt/ghc
+          sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
           sudo apt clean
           docker rmi $(docker images -q) -f
           df -h
@@ -87,4 +86,4 @@ jobs:
           # Build the new website
           site2/tools/docker-build-site.sh
           # Script was initially made for travis
-          bash -e site2/tools/publish-website.sh
\ No newline at end of file
+          bash -e site2/tools/publish-website.sh
diff --git a/.github/workflows/ci-shade-test.yaml 
b/.github/workflows/ci-shade-test.yaml
index dd70074..7548ca1 100644
--- a/.github/workflows/ci-shade-test.yaml
+++ b/.github/workflows/ci-shade-test.yaml
@@ -79,8 +79,7 @@ jobs:
       - name: clean disk
         if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
         run: |
-          sudo swapoff -a
-          sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android 
/opt/ghc
+          sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
           sudo apt clean
           docker rmi $(docker images -q) -f
           df -h
diff --git a/tests/docker-images/latest-version-image/Dockerfile 
b/tests/docker-images/latest-version-image/Dockerfile
index 242ae47..f0022cb 100644
--- a/tests/docker-images/latest-version-image/Dockerfile
+++ b/tests/docker-images/latest-version-image/Dockerfile
@@ -77,6 +77,8 @@ COPY scripts/init-cluster.sh scripts/run-global-zk.sh 
scripts/run-local-zk.sh \
      scripts/run-standalone.sh \
      /pulsar/bin/
 
+COPY conf/presto/jvm.config /pulsar/conf/presto/
+
 # copy python test examples
 RUN mkdir -p /pulsar/instances/deps
 COPY python-examples/exclamation_lib.py /pulsar/instances/deps/
diff --git a/tests/docker-images/latest-version-image/conf/presto/jvm.config 
b/tests/docker-images/latest-version-image/conf/presto/jvm.config
new file mode 100644
index 0000000..28db36a
--- /dev/null
+++ b/tests/docker-images/latest-version-image/conf/presto/jvm.config
@@ -0,0 +1,30 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+-server
+-Xms128M
+-Xmx1500M
+-XX:+UseG1GC
+-XX:G1HeapRegionSize=32M
+-XX:+UseGCOverheadLimit
+-XX:+ExplicitGCInvokesConcurrent
+-XX:+HeapDumpOnOutOfMemoryError
+-XX:+ExitOnOutOfMemoryError
+-Dpresto-temporarily-allow-java8=true
+-Djdk.attach.allowAttachSelf=true
diff --git a/tests/integration/pom.xml b/tests/integration/pom.xml
index 78dca48..c45f1e7 100644
--- a/tests/integration/pom.xml
+++ b/tests/integration/pom.xml
@@ -225,7 +225,7 @@
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
-              <argLine>-Xmx2G -XX:MaxDirectMemorySize=8G
+              <argLine>-Xmx1G -XX:MaxDirectMemorySize=1G
               -Dio.netty.leakDetectionLevel=advanced
               </argLine>
               <skipTests>false</skipTests>
diff --git 
a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/ChaosContainer.java
 
b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/ChaosContainer.java
index 6064d5b..3896777 100644
--- 
a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/ChaosContainer.java
+++ 
b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/ChaosContainer.java
@@ -46,6 +46,12 @@ public class ChaosContainer<SelfT extends 
ChaosContainer<SelfT>> extends Generic
         this.clusterName = clusterName;
     }
 
+    @Override
+    protected void configure() {
+        super.configure();
+        addEnv("MALLOC_ARENA_MAX", "1");
+    }
+
     protected void beforeStop() {
         if (null == getContainerId()) {
             return;
diff --git 
a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/PulsarContainer.java
 
b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/PulsarContainer.java
index 74963e3..46f50fc 100644
--- 
a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/PulsarContainer.java
+++ 
b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/PulsarContainer.java
@@ -147,6 +147,7 @@ public abstract class PulsarContainer<SelfT extends 
PulsarContainer<SelfT>> exte
 
     @Override
     protected void configure() {
+        super.configure();
         if (httpPort > 0) {
             addExposedPorts(httpPort);
         }
diff --git 
a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/StandaloneContainer.java
 
b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/StandaloneContainer.java
index cc47d44..819e328 100644
--- 
a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/StandaloneContainer.java
+++ 
b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/StandaloneContainer.java
@@ -54,6 +54,7 @@ public class StandaloneContainer extends 
PulsarContainer<StandaloneContainer> {
     protected void configure() {
         super.configure();
         setCommand("standalone");
+        addEnv("PULSAR_MEM", "-Xms128M -Xmx1g -XX:MaxDirectMemorySize=1g");
     }
 
     @Override

Reply via email to