Increasing memory given to maven using MAVEN_OPTS did not solve the problem. As this setting just increases the memory given to the build process and not the individual test cases. The solution was to use the following configuration in the surefire plugin.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkMode>pertest</forkMode>
<argLine>-Xms256m -Xmx512m</argLine> <testFailureIgnore>false</testFailureIgnore>
<skip>false</skip>
<includes>
<include>**/*IntegrationTestSuite.java</include>
</includes>
</configuration>
</plugin>
The pom for the integration test can be found here. This fixed the heap space issue and now we have our test cases running on the nightly build. You can see the status of our nightly builds at http://builder.wso2.org/browse/MASHUP-NIGHTLY
Sounds like your code is leaking static data structures; might be worth tracking that down...
ReplyDeleteIt works, thank you!
ReplyDeletesure does work. I had a hard time figuring this out, that's the very reason I thought a blog post on that will be useful for others facing the same situation. Good to hear that someone befited from it.
ReplyDeleteWe were butting our heads against this for a while. Like you, we tried setting MAVEN_OPTS to no avail. Your solution did work for us. Thanks, Keith!
ReplyDeleteOur situation is slightly weirder because developers on Macs didn't have problems with running out of memory in the tests but developers in windows did, so we ended up putting our override of memory settings in our individual .m2/settings.xml files.
Thank you very much for this very valuable and interesting post!
ReplyDeleteVery helpful - thanks a lot!
ReplyDeleteThank you. You saved couple of hours of my life.
ReplyDeleteThanks for the tip.
ReplyDeleteI kept increasing MAVEN_OPTS heap size without any effect!
Gotta love Maven... :p
maaan thanku so very much!! god bless!
ReplyDeletethanks for the code, it worked like charm for me.
ReplyDelete@Mark Kunichika - You could consider putting a Maven profile in your pom.xml that only activates for Windows users, rather than requiring Windows users to edit their settings.xml?
ReplyDeleteThank you very much you saved lot of time
ReplyDelete