diff --git a/regression-test/framework/pom.xml b/regression-test/framework/pom.xml index 91d97ec1071987..45b589185b854b 100644 --- a/regression-test/framework/pom.xml +++ b/regression-test/framework/pom.xml @@ -69,8 +69,8 @@ under the License. ${doris.home}/thirdparty/installed/bin/thrift ${doris.home}/gensrc/thrift UTF-8 - 1.8 - 1.8 + 17 + 17 1.0-SNAPSHOT github 4.0.19 @@ -78,8 +78,9 @@ under the License. 2.8.0 1.11.95 2.13.5 - - 17.0.0 + + 19.0.0 @@ -488,7 +489,7 @@ under the License. io.netty netty-all - 4.1.104.Final + 4.2.15.Final org.awaitility diff --git a/regression-test/pipeline/cloud_p0/run.sh b/regression-test/pipeline/cloud_p0/run.sh index a011fb954beecc..7728cd94698226 100644 --- a/regression-test/pipeline/cloud_p0/run.sh +++ b/regression-test/pipeline/cloud_p0/run.sh @@ -74,8 +74,11 @@ run() { sed -i "s/oss-cn-hongkong.aliyuncs.com/oss-cn-hongkong-internal.aliyuncs.com/" "${teamcity_build_checkoutDir}"/docker/thirdparties/custom_settings.env if bash "${teamcity_build_checkoutDir}"/docker/thirdparties/run-thirdparties-docker.sh --stop; then echo; fi if bash "${teamcity_build_checkoutDir}"/docker/thirdparties/run-thirdparties-docker.sh -c kafka; then echo; else echo "ERROR: start kafka docker failed"; fi - JAVA_HOME="$(find /usr/lib/jvm -maxdepth 1 -type d -name 'java-8-*' | sed -n '1p')" + # Run the regression suite under JDK 17: the Arrow Flight SQL JDBC driver (arrow 19) + # is Java 11+ bytecode and cannot be loaded by a JDK 8 runtime. + JAVA_HOME="$(find /usr/lib/jvm -maxdepth 1 -type d -name 'java-17-*' | sed -n '1p')" export JAVA_HOME + export PATH="${JAVA_HOME}/bin:${PATH}" if "${teamcity_build_checkoutDir}"/run-regression-test.sh \ --teamcity \ --run \ diff --git a/regression-test/pipeline/common/doris-utils.sh b/regression-test/pipeline/common/doris-utils.sh index cbc27ee6999c18..00b6bc9f40a47c 100644 --- a/regression-test/pipeline/common/doris-utils.sh +++ b/regression-test/pipeline/common/doris-utils.sh @@ -985,9 +985,9 @@ prepare_java_udf() { # custom_lib相关的case需要在fe启动前把编译好的jar放到 $DORIS_HOME/fe/custom_lib/ install_java install_maven - OLD_JAVA_HOME=${JAVA_HOME} - JAVA_HOME="$(find /usr/lib/jvm -maxdepth 1 -type d -name 'java-8-*' | sed -n '1p')" - export JAVA_HOME + # Build with the ambient JDK (>=17 in CI): the regression framework is compiled with it, + # while run-regression-test.sh internally switches to JDK 8 only for the Java UDF module + # (which must stay Java 8 for the BE embedded JVM). bash "${DORIS_HOME}"/../run-regression-test.sh --clean if bash "${DORIS_HOME}"/../run-regression-test.sh --compile || bash "${DORIS_HOME}"/../run-regression-test.sh --compile || @@ -996,8 +996,6 @@ prepare_java_udf() { else echo "ERROR: failed to compile java udf" fi - JAVA_HOME=${OLD_JAVA_HOME} - export JAVA_HOME if ls "${DORIS_HOME}"/fe/custom_lib/*.jar && ls "${DORIS_HOME}"/be/custom_lib/*.jar; then diff --git a/regression-test/pipeline/vault_p0/run.sh b/regression-test/pipeline/vault_p0/run.sh index 9a86d3cda200f1..a8a252b554f70d 100644 --- a/regression-test/pipeline/vault_p0/run.sh +++ b/regression-test/pipeline/vault_p0/run.sh @@ -114,8 +114,11 @@ services: network_mode: "host" ' if echo "${docker_compose_hdfs_yaml}" >docker-compose.yaml && docker-compose up -d; then echo; else echo "ERROR: start hdfs docker failed"; fi - JAVA_HOME="$(find /usr/lib/jvm -maxdepth 1 -type d -name 'java-8-*' | sed -n '1p')" + # Run the regression suite under JDK 17: the Arrow Flight SQL JDBC driver (arrow 19) + # is Java 11+ bytecode and cannot be loaded by a JDK 8 runtime. + JAVA_HOME="$(find /usr/lib/jvm -maxdepth 1 -type d -name 'java-17-*' | sed -n '1p')" export JAVA_HOME + export PATH="${JAVA_HOME}/bin:${PATH}" if "${teamcity_build_checkoutDir}"/run-regression-test.sh \ --teamcity \ --run \ diff --git a/regression-test/suites/vault_p0/create/test_nereids_show_create_storage_vault.groovy b/regression-test/suites/vault_p0/create/test_nereids_show_create_storage_vault.groovy index fc38f3b22a3833..2e1504218fd4bb 100644 --- a/regression-test/suites/vault_p0/create/test_nereids_show_create_storage_vault.groovy +++ b/regression-test/suites/vault_p0/create/test_nereids_show_create_storage_vault.groovy @@ -83,11 +83,11 @@ suite("test_show_create_storage_vault_command") { def hdfsVaultInfo = try_sql """SHOW CREATE STORAGE VAULT ${hdfsVaultName}""" def s3VaultInfo = try_sql """SHOW CREATE STORAGE VAULT ${s3VaultName}""" - if (hdfsVaultInfo.size == 1) { + if (hdfsVaultInfo.size() == 1) { hdfsVaultExist = true } - if (s3VaultInfo.size == 1) { + if (s3VaultInfo.size() == 1) { s3VaultExist = true } diff --git a/run-regression-test.sh b/run-regression-test.sh index ebf2ecf5f6bbde..87143a2cda5545 100755 --- a/run-regression-test.sh +++ b/run-regression-test.sh @@ -225,13 +225,35 @@ if ! test -f ${RUN_JAR:+${RUN_JAR}}; then echo "===== BUILD JAVA_UDF_SRC TO GENERATE JAR =====" mkdir -p "${DORIS_HOME}"/regression-test/suites/javaudf_p0/jars cd "${DORIS_HOME}"/regression-test/java-udf-src || { echo "Failed to change directory to java-udf-src"; exit 1; } - + + # The Java UDF jar must be built with JDK 8 (source/target 8, loaded by the BE embedded + # JVM), while the framework above is built with the ambient JDK (>=17 in CI). Switch to a + # JDK 8 just for this module, falling back to the ambient JDK if none is installed + # (e.g. local dev boxes). + udf_prev_java_home="${JAVA_HOME:-}" + udf_jdk8_home="$(find /usr/lib/jvm -maxdepth 1 -type d -name 'java-8-*' 2>/dev/null | sed -n '1p')" + if [[ -n "${udf_jdk8_home}" ]]; then + echo "Building Java UDF with JDK 8 at ${udf_jdk8_home}" + export JAVA_HOME="${udf_jdk8_home}" + else + echo "WARNING: no JDK 8 found under /usr/lib/jvm; building Java UDF with ${JAVA_HOME:-the current JDK}" + fi + # Build UDF with retry - execute_maven_with_retry "${MVN_CMD} clean package -B -DskipTests=true -Dmaven.javadoc.skip=true" || { + udf_build_rc=0 + execute_maven_with_retry "${MVN_CMD} clean package -B -DskipTests=true -Dmaven.javadoc.skip=true" || udf_build_rc=1 + + # Restore the framework JDK regardless of the UDF build result. + if [[ -n "${udf_prev_java_home}" ]]; then + export JAVA_HOME="${udf_prev_java_home}" + else + unset JAVA_HOME + fi + if [[ "${udf_build_rc}" -ne 0 ]]; then echo "Failed to build UDF package" exit 1 - } - + fi + cp target/java-udf-case-jar-with-dependencies.jar "${DORIS_HOME}"/regression-test/suites/javaudf_p0/jars/ # be and fe dir is compiled output mkdir -p "${DORIS_HOME}"/output/fe/custom_lib/