Skip to content

Commit ad6762a

Browse files
authored
--add-opens JVM flags (#39302)
1 parent 23e2398 commit ad6762a

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

sdks/java/testing/load-tests/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,19 @@ if (isSparkRunner) {
9696
}
9797
}
9898

99+
def sparkJvmArgs() {
100+
def testJavaVer = project.findProperty('testJavaVersion') ? (project.property('testJavaVersion') as int) : JavaVersion.current().majorVersion.toInteger()
101+
if (testJavaVer >= 17) {
102+
return [
103+
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
104+
"--add-opens=java.base/java.nio=ALL-UNNAMED",
105+
"--add-opens=java.base/java.util=ALL-UNNAMED",
106+
"--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
107+
]
108+
}
109+
return []
110+
}
111+
99112
def getLoadTestArgs = {
100113
def loadTestArgs = project.findProperty(loadTestArgsProperty) ?: ""
101114
def loadTestArgsList = new ArrayList<String>()
@@ -133,6 +146,7 @@ task run(type: JavaExec) {
133146
// Disable UI
134147
systemProperty "spark.ui.enabled", "false"
135148
systemProperty "spark.ui.showConsoleProgress", "false"
149+
jvmArgs += sparkJvmArgs()
136150
}
137151

138152
mainClass = project.findProperty(mainClassProperty)

0 commit comments

Comments
 (0)