This is an automated email from the ASF dual-hosted git repository.

stigahuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 3089b918705f73bbace52919da247d20fec1681a
Author: Riza Suminto <riza.sumi...@cloudera.com>
AuthorDate: Wed Jul 2 18:18:17 2025 -0700

    IMPALA-14187: (Addendum) Maintain consistent IMPALA_JAVA_TARGET
    
    impala-config-java.sh (evaluated through impala-config.sh) can be
    sourced twice: buildall.sh and run-all-tests.sh. When TEST_JDK_VERSION
    or TEST_JAVA_HOME_OVERRIDE is set, run-all-tests.sh can reinitialize
    IMPALA_JAVA_TARGET with different value than what it was during
    buildall.sh.
    
    This patch makes IMPALA_JAVA_TARGET consistent both during build and
    test by restoring IMPALA_JAVA_TARGET to its original value at
    run-all-tests.sh.
    
    This patch assumes that TEST_JDK_VERSION or TEST_JAVA_HOME_OVERRIDE (if
    set) is greater version than IMPALA_JDK_VERSION, but does not validate
    it.
    
    Testing:
    Pass all FE test with IMPALA_JDK_VERSION=8 and TEST_JDK_VERSION=17.
    
    Change-Id: Ia1e9d09ac086ea66a5f17ff1c0932f27ac5d5567
    Reviewed-on: http://gerrit.cloudera.org:8080/23115
    Reviewed-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
    Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
---
 bin/run-all-tests.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/bin/run-all-tests.sh b/bin/run-all-tests.sh
index 7ba2dbefd..c010be0e3 100755
--- a/bin/run-all-tests.sh
+++ b/bin/run-all-tests.sh
@@ -33,6 +33,9 @@ setup_report_build_error
 KERB_ARGS=""
 
 # Use a different JDK for testing. Picked up by impala-config and 
start-impala-cluster.
+# Preserve build-time IMPALA_JAVA_TARGET to restore to its original value in
+# run-all-tests.sh later, because sourcing impala-config.sh below might 
override it.
+: ${IMPALA_JAVA_TARGET_AT_BUILD:=${IMPALA_JAVA_TARGET}}
 if [ ! -z "${TEST_JAVA_HOME_OVERRIDE:-}" ]; then
   export MINICLUSTER_JAVA_HOME="${JAVA_HOME}"
   export IMPALA_JAVA_HOME_OVERRIDE="${TEST_JAVA_HOME_OVERRIDE}"
@@ -42,6 +45,10 @@ elif [ ! -z "${TEST_JDK_VERSION:-}" ]; then
 fi
 
 . "${IMPALA_HOME}/bin/impala-config.sh" > /dev/null 2>&1
+if [[ -n "${IMPALA_JAVA_TARGET_AT_BUILD}" ]]; then
+  export IMPALA_JAVA_TARGET=${IMPALA_JAVA_TARGET_AT_BUILD}
+  echo "Restore IMPALA_JAVA_TARGET to ${IMPALA_JAVA_TARGET}"
+fi
 . "${IMPALA_HOME}/testdata/bin/run-step.sh"
 if "${CLUSTER_DIR}/admin" is_kerberized; then
   KERB_ARGS="--use_kerberos"

Reply via email to