Skip to content

Commit

Permalink
ARROW-5412: [Integration] Add Java option for netty reflection
Browse files Browse the repository at this point in the history
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
  • Loading branch information
BryanCutler committed Jun 13, 2019
1 parent b7e8ed7 commit 3439ba9
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions integration/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,8 @@ class JavaTester(Tester):

FLIGHT_PORT = 31338

JAVA_OPTS = ['-Dio.netty.tryReflectionSetAccessible=true']

_arrow_version = load_version_from_pom()
ARROW_TOOLS_JAR = os.environ.get(
'ARROW_JAVA_INTEGRATION_JAR',
Expand All @@ -1326,8 +1328,8 @@ class JavaTester(Tester):
name = 'Java'

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

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

def stream_to_file(self, stream_path, file_path):
cmd = ['java', '-cp', self.ARROW_TOOLS_JAR,
'org.apache.arrow.tools.StreamToFile',
stream_path, file_path]
cmd = ['java'] + self.JAVA_OPTS + \
['-cp', self.ARROW_TOOLS_JAR,
'org.apache.arrow.tools.StreamToFile', stream_path, file_path]
if self.debug:
print(' '.join(cmd))
run_cmd(cmd)

def file_to_stream(self, file_path, stream_path):
cmd = ['java', '-cp', self.ARROW_TOOLS_JAR,
'org.apache.arrow.tools.FileToStream',
file_path, stream_path]
cmd = ['java'] + self.JAVA_OPTS + \
['-cp', self.ARROW_TOOLS_JAR,
'org.apache.arrow.tools.FileToStream', file_path, stream_path]
if self.debug:
print(' '.join(cmd))
run_cmd(cmd)

def flight_request(self, port, json_path):
cmd = ['java', '-cp', self.ARROW_FLIGHT_JAR,
self.ARROW_FLIGHT_CLIENT,
'-port', str(port),
'-j', json_path]
cmd = ['java'] + self.JAVA_OPTS + \
['-cp', self.ARROW_FLIGHT_JAR, self.ARROW_FLIGHT_CLIENT,
'-port', str(port), '-j', json_path]
if self.debug:
print(' '.join(cmd))
run_cmd(cmd)

@contextlib.contextmanager
def flight_server(self):
cmd = ['java', '-cp', self.ARROW_FLIGHT_JAR,
self.ARROW_FLIGHT_SERVER,
'-port', str(self.FLIGHT_PORT)]
cmd = ['java'] + self.JAVA_OPTS + \
['-cp', self.ARROW_FLIGHT_JAR, self.ARROW_FLIGHT_SERVER,
'-port', str(self.FLIGHT_PORT)]
if self.debug:
print(' '.join(cmd))
server = subprocess.Popen(cmd, stdout=subprocess.PIPE)
Expand Down

0 comments on commit 3439ba9

Please sign in to comment.