Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OOME when there are many tests failures #49

Open
aheritier opened this issue Nov 14, 2023 · 1 comment
Open

OOME when there are many tests failures #49

aheritier opened this issue Nov 14, 2023 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@aheritier
Copy link

We have a project with 700+ tests and on our CI we noticed multiple times OOME errors (sadly we weren't able to get a dump) when our tests are failing.

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "surefire-forkedjvm-command-thread"

failsafe / surefire are configured with

<!-- Custom reports -->
<reportFormat>plain</reportFormat>
<consoleOutputReporter>
    <disable>true</disable>
</consoleOutputReporter>
<statelessTestsetInfoReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter"/>

and JUnit with

junit.jupiter.execution.parallel.enabled=true
junit.jupiter.execution.parallel.mode.default=same_thread
junit.jupiter.execution.parallel.mode.classes.default=concurrent

To display the tests results as tree I suppose the reporting is keeping in memory many informations due to the execution of tests in parallel (I see several statics fileds in https://github.com/fabriciorby/maven-surefire-junit5-tree-reporter/blob/master/src/main/java/org/apache/maven/plugin/surefire/report/TestReportHandler.java#L12-L15)

If there are several failures and the memory is limited like in a CI system a surefire JVM can die with an OOME because of the TestReportHandler size. We could probably increase the tests JVMs size but it's a bit annoying to do it just for the tests reporter.

@fabriciorby
Copy link
Owner

Hmmm, this is difficult for me to reproduce, the problem is probably in this part that you mentioned. I think it could be possible to prune the already executed tests information for a non parallel execution, for a parallel one I don't think it would be possible.

I'll flag it as a bug for now and get back later. (Hopefully less than 1 year)

@fabriciorby fabriciorby added bug Something isn't working help wanted Extra attention is needed labels Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants