Limit heap size in Groovy integration tests 89/137089/3
authordanielhanrahan <daniel.hanrahan@est.tech>
Mon, 29 Jan 2024 14:28:06 +0000 (14:28 +0000)
committerDaniel Hanrahan <daniel.hanrahan@est.tech>
Thu, 1 Feb 2024 13:07:56 +0000 (13:07 +0000)
Configure maven to limit heap size in integration tests to
help detect OutOfMemory errors in groovy tests.
The figure 512MB was chosen as this is 25% of 2GB
(JVM by default uses 25% of total memory for heap).

Issue-ID: CPS-2052
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Change-Id: Ie1160f85ba3970e4c43fccee41c2821dc83a8e53

integration-test/pom.xml

index f03b1c6..3ac0964 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
   ============LICENSE_START=======================================================
-  Copyright (c) 2023 Nordix Foundation
+  Copyright (c) 2023-2024 Nordix Foundation
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
         </dependency>
     </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-failsafe-plugin</artifactId>
+                <configuration>
+                    <argLine>-Xms512m -Xmx512m</argLine>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <argLine>-Xms512m -Xmx512m</argLine>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
     <profiles>
         <profile>
             <id>default</id>