Skip to content

Commit dca21a8

Browse files
fe2sJoshRosen
authored andcommitted
[SPARK-8558] [BUILD] Script /dev/run-tests fails when _JAVA_OPTIONS env var set
Author: fe2s <[email protected]> Author: Oleksiy Dyagilev <[email protected]> Closes apache#6956 from fe2s/fix-run-tests and squashes the following commits: 31b6edc [fe2s] str is a built-in function, so using it as a variable name will lead to spurious warnings in some Python linters 7d781a0 [fe2s] fixing for openjdk/IBM, seems like they have slightly different wording, but all have 'version' word. Surrounding with spaces for the case if version word appears in _JAVA_OPTIONS cd455ef [fe2s] address comment, looking for java version string rather than expecting to have on a certain line number ad577d7 [Oleksiy Dyagilev] [SPARK-8558][BUILD] Script /dev/run-tests fails when _JAVA_OPTIONS env var set
1 parent 8ab5076 commit dca21a8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dev/run-tests.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,12 @@ def determine_java_version(java_exe):
477477

478478
raw_output = subprocess.check_output([java_exe, "-version"],
479479
stderr=subprocess.STDOUT)
480-
raw_version_str = raw_output.split('\n')[0] # eg 'java version "1.8.0_25"'
480+
481+
raw_output_lines = raw_output.split('\n')
482+
483+
# find raw version string, eg 'java version "1.8.0_25"'
484+
raw_version_str = next(x for x in raw_output_lines if " version " in x)
485+
481486
version_str = raw_version_str.split()[-1].strip('"') # eg '1.8.0_25'
482487
version, update = version_str.split('_') # eg ['1.8.0', '25']
483488

0 commit comments

Comments
 (0)