Skip to content

Commit

Permalink
HHH-16964 Disable Log4J2's management beans during integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne committed Aug 1, 2023
1 parent 91df5f1 commit ebab541
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 6 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Keep all these properties in sync unless you know what you are doing!
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8
toolchain.compiler.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8
toolchain.javadoc.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8
toolchain.launcher.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8
# We set '-Dlog4j2.disableJmx=true' to prevent classloader leaks triggered by the logger.
# (Some of these settings need to be repeated in the test.jvmArgs blocks of each module)
org.gradle.jvmargs=-Dlog4j2.disableJmx -Xmx2g -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8
toolchain.compiler.jvmargs=-Dlog4j2.disableJmx=true -Xmx2g -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8
toolchain.javadoc.jvmargs=-Dlog4j2.disableJmx=true -Xmx2g -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8
toolchain.launcher.jvmargs=-Dlog4j2.disableJmx=true -Xmx2g -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8

org.gradle.parallel=true

Expand Down
3 changes: 3 additions & 0 deletions hibernate-core/hibernate-core.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ tasks.withType( Test.class ).each { test ->
test.jvmArgs( ['--add-opens', 'java.base/java.security=ALL-UNNAMED'] )
test.jvmArgs( ['--add-opens', 'java.base/java.lang=ALL-UNNAMED'] )

//Avoid Log4J2 classloader leaks:
test.jvmArgs( ['-Dlog4j2.disableJmx=true'] )

test.beforeTest { descriptor ->
//println "Starting test: " + descriptor
}
Expand Down

0 comments on commit ebab541

Please sign in to comment.