Skip to content

Commit

Permalink
Explicitly set illegal-access to deny for tests (#72588) (#78283)
Browse files Browse the repository at this point in the history
Since Java 16, the default value for illegal-access is deny. This means
the latest release of Elasticsearch, and all current integration tests,
run with deny (since we don't explicitly set it in jvm options). Yet
tests run with illegal-access=warn, for legacy reasons. #71908
proposed to remove the setting from test jvms, but concerns were raised
there about whether this would cause some test failures.

This commit explicitly sets tests to deny. This has the added benefit
that any failures will be caught even when running tests with older
jvms.
  • Loading branch information
rjernst committed Sep 23, 2021
1 parent 7089fc6 commit fd94e35
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,15 @@ class BuildPlugin implements Plugin<Project> {
heapdumpDir.mkdirs()
jvmArg '-XX:HeapDumpPath=' + heapdumpDir
if (project.runtimeJavaVersion >= JavaVersion.VERSION_1_9) {
jvmArg '--illegal-access=warn'
jvmArg '--illegal-access=deny'
jvmArg '--add-opens=java.base/java.security.cert=ALL-UNNAMED'
jvmArg '--add-opens=java.base/java.nio.channels=ALL-UNNAMED'
jvmArg '--add-opens=java.base/java.net=ALL-UNNAMED'
jvmArg '--add-opens=java.base/javax.net.ssl=ALL-UNNAMED'
jvmArg '--add-opens=java.base/java.nio.file=ALL-UNNAMED'
jvmArg '--add-opens=java.base/java.time=ALL-UNNAMED'
jvmArg '--add-opens=java.base/java.lang=ALL-UNNAMED'
jvmArg '--add-opens=java.management/java.lang.management=ALL-UNNAMED'
}
argLine System.getProperty('tests.jvm.argline')

Expand Down

0 comments on commit fd94e35

Please sign in to comment.