Skip to content

Commit 3439ba9

Browse files
committed
ARROW-5412: [Integration] Add Java option for netty reflection
After ARROW-3191, Java requires the property `io.netty.tryReflectionSetAccessible` to be set to `true` for JDK >= 9. This is already in the root POM, but causes integration tests to fail. This adds the property and an option to the Java command when running integration tests. Author: Bryan Cutler <cutlerb@gmail.com> Closes #4522 from BryanCutler/java-integration-netty-conf-ARROW-5412 and squashes the following commits: 25bec06 <Bryan Cutler> fix flake check d6f0eee <Bryan Cutler> Added '-Dio.netty.tryReflectionSetAccessible=true' property to Java integration test command
1 parent b7e8ed7 commit 3439ba9

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

integration/integration_test.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,8 @@ class JavaTester(Tester):
13071307

13081308
FLIGHT_PORT = 31338
13091309

1310+
JAVA_OPTS = ['-Dio.netty.tryReflectionSetAccessible=true']
1311+
13101312
_arrow_version = load_version_from_pom()
13111313
ARROW_TOOLS_JAR = os.environ.get(
13121314
'ARROW_JAVA_INTEGRATION_JAR',
@@ -1326,8 +1328,8 @@ class JavaTester(Tester):
13261328
name = 'Java'
13271329

13281330
def _run(self, arrow_path=None, json_path=None, command='VALIDATE'):
1329-
cmd = ['java', '-cp', self.ARROW_TOOLS_JAR,
1330-
'org.apache.arrow.tools.Integration']
1331+
cmd = ['java'] + self.JAVA_OPTS + \
1332+
['-cp', self.ARROW_TOOLS_JAR, 'org.apache.arrow.tools.Integration']
13311333

13321334
if arrow_path is not None:
13331335
cmd.extend(['-a', arrow_path])
@@ -1349,35 +1351,34 @@ def json_to_file(self, json_path, arrow_path):
13491351
return self._run(arrow_path, json_path, 'JSON_TO_ARROW')
13501352

13511353
def stream_to_file(self, stream_path, file_path):
1352-
cmd = ['java', '-cp', self.ARROW_TOOLS_JAR,
1353-
'org.apache.arrow.tools.StreamToFile',
1354-
stream_path, file_path]
1354+
cmd = ['java'] + self.JAVA_OPTS + \
1355+
['-cp', self.ARROW_TOOLS_JAR,
1356+
'org.apache.arrow.tools.StreamToFile', stream_path, file_path]
13551357
if self.debug:
13561358
print(' '.join(cmd))
13571359
run_cmd(cmd)
13581360

13591361
def file_to_stream(self, file_path, stream_path):
1360-
cmd = ['java', '-cp', self.ARROW_TOOLS_JAR,
1361-
'org.apache.arrow.tools.FileToStream',
1362-
file_path, stream_path]
1362+
cmd = ['java'] + self.JAVA_OPTS + \
1363+
['-cp', self.ARROW_TOOLS_JAR,
1364+
'org.apache.arrow.tools.FileToStream', file_path, stream_path]
13631365
if self.debug:
13641366
print(' '.join(cmd))
13651367
run_cmd(cmd)
13661368

13671369
def flight_request(self, port, json_path):
1368-
cmd = ['java', '-cp', self.ARROW_FLIGHT_JAR,
1369-
self.ARROW_FLIGHT_CLIENT,
1370-
'-port', str(port),
1371-
'-j', json_path]
1370+
cmd = ['java'] + self.JAVA_OPTS + \
1371+
['-cp', self.ARROW_FLIGHT_JAR, self.ARROW_FLIGHT_CLIENT,
1372+
'-port', str(port), '-j', json_path]
13721373
if self.debug:
13731374
print(' '.join(cmd))
13741375
run_cmd(cmd)
13751376

13761377
@contextlib.contextmanager
13771378
def flight_server(self):
1378-
cmd = ['java', '-cp', self.ARROW_FLIGHT_JAR,
1379-
self.ARROW_FLIGHT_SERVER,
1380-
'-port', str(self.FLIGHT_PORT)]
1379+
cmd = ['java'] + self.JAVA_OPTS + \
1380+
['-cp', self.ARROW_FLIGHT_JAR, self.ARROW_FLIGHT_SERVER,
1381+
'-port', str(self.FLIGHT_PORT)]
13811382
if self.debug:
13821383
print(' '.join(cmd))
13831384
server = subprocess.Popen(cmd, stdout=subprocess.PIPE)

0 commit comments

Comments
 (0)