From d288d50c9639e66801e3e0abb9796d73922706c1 Mon Sep 17 00:00:00 2001 From: taos-support Date: Fri, 20 Mar 2026 15:18:53 +0800 Subject: [PATCH 01/11] feat: add upgrade compatbile test task --- .github/scripts/test_runner.py | 12 ++++++++++++ .github/workflows/new-framework-test.yml | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/.github/scripts/test_runner.py b/.github/scripts/test_runner.py index 38cb249..bfe3e67 100644 --- a/.github/scripts/test_runner.py +++ b/.github/scripts/test_runner.py @@ -356,6 +356,16 @@ def run_function_test(self): self.utils.run_command(windows_copy_dll_cmd) self.utils.run_command(windows_cmds) + def run_upgrade_compat_test(self): + """Run cold/hot upgrade compatibility tests in an isolated Docker container (Linux only)""" + print(f"PR number: {self.pr_number}, run number: {self.run_number}, attempt: {self.run_attempt}") + log_dir = self.utils.path(self.wkdir, "log", "upgrade_compat") + cmd = ( + f"cd {self.wkc}/test/ci && " + f"bash run_upgrade_compat.sh -w {self.wkdir} -l {log_dir} -e" + ) + self.utils.run_command(cmd, silent=False) + def run_tdgpt_test(self): print(f"timeout: {self.timeout}") @@ -378,6 +388,8 @@ def run(self): self.run_function_test() if self.platform == "linux": self.cleanup() + elif self.test_type == "upgrade_compat": + self.run_upgrade_compat_test() elif self.test_type == "tdgpt": self.run_tdgpt_test() else: diff --git a/.github/workflows/new-framework-test.yml b/.github/workflows/new-framework-test.yml index 1bc0d74..8005251 100644 --- a/.github/workflows/new-framework-test.yml +++ b/.github/workflows/new-framework-test.yml @@ -168,3 +168,9 @@ jobs: run: python3 test_runner.py env: TEST_TYPE: "function" + + - name: Run upgrade compatibility tests + if: matrix.platform == 'linux' + run: python3 test_runner.py + env: + TEST_TYPE: "upgrade_compat" From 1e6011dfa42d8b0a0b3532a9a4a187805177f112 Mon Sep 17 00:00:00 2001 From: taos-support Date: Fri, 20 Mar 2026 15:53:37 +0800 Subject: [PATCH 02/11] feat: branch switch to compat_branch --- .github/workflows/new-framework-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/new-framework-test.yml b/.github/workflows/new-framework-test.yml index 8005251..59d243b 100644 --- a/.github/workflows/new-framework-test.yml +++ b/.github/workflows/new-framework-test.yml @@ -109,7 +109,7 @@ jobs: uses: actions/checkout@v4 with: repository: "taosdata/.github" - ref: "main" + ref: "compat_branch" fetch-depth: 0 - name: Debug env From 658975aff8e38d7debec61fd3269a4e91ac18b55 Mon Sep 17 00:00:00 2001 From: taos-support Date: Fri, 20 Mar 2026 16:34:58 +0800 Subject: [PATCH 03/11] set concurrent run compatible test case --- .github/workflows/new-framework-test.yml | 47 ++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/.github/workflows/new-framework-test.yml b/.github/workflows/new-framework-test.yml index 59d243b..882dc87 100644 --- a/.github/workflows/new-framework-test.yml +++ b/.github/workflows/new-framework-test.yml @@ -163,14 +163,53 @@ jobs: env: TEST_TYPE: "function_returns" + - name: Start upgrade compatibility tests + if: matrix.platform == 'linux' + run: | + log_dir="${WKDIR}/log/upgrade_compat" + mkdir -p "${WKDIR}/tmp" "$log_dir" + ( + bash ${WKC}/test/ci/run_upgrade_compat.sh -w ${WKDIR} -l ${log_dir} -e \ + >> "${log_dir}/ci_output.log" 2>&1 + echo $? > "${WKDIR}/tmp/upgrade_compat_exit.txt" + ) & + echo $! > "${WKDIR}/tmp/upgrade_compat.pid" + echo "[upgrade_compat] Started in background, PID=$(cat ${WKDIR}/tmp/upgrade_compat.pid)" + - name: Run function test cases if: matrix.platform == 'linux' || env.TARGET_BRANCH != '3.3.6' run: python3 test_runner.py env: TEST_TYPE: "function" - - name: Run upgrade compatibility tests + - name: Wait upgrade compatibility tests finished if: matrix.platform == 'linux' - run: python3 test_runner.py - env: - TEST_TYPE: "upgrade_compat" + run: | + pid_file="${WKDIR}/tmp/upgrade_compat.pid" + exit_file="${WKDIR}/tmp/upgrade_compat_exit.txt" + log_file="${WKDIR}/log/upgrade_compat/ci_output.log" + + if [ ! -f "$pid_file" ]; then + echo "ERROR: upgrade compat was not started (no PID file found)" + exit 1 + fi + + pid=$(cat "$pid_file") + echo "[upgrade_compat] Waiting for process (PID: $pid) to finish..." + while kill -0 "$pid" 2>/dev/null; do + sleep 10 + done + echo "[upgrade_compat] Process completed." + + echo "==================== upgrade_compat output ====================" + [ -f "$log_file" ] && cat "$log_file" || echo "(no log file found)" + echo "===============================================================" + + if [ -f "$exit_file" ]; then + ret=$(cat "$exit_file") + echo "[upgrade_compat] Exit code: $ret" + exit $ret + else + echo "ERROR: no exit code file found, assuming failure" + exit 1 + fi From e34d4e3e08bf50244a9d6de7092b2c30d5fb4c83 Mon Sep 17 00:00:00 2001 From: taos-support Date: Fri, 20 Mar 2026 17:25:30 +0800 Subject: [PATCH 04/11] feat: add show information on task list --- .github/workflows/new-framework-test.yml | 34 ++++++++++++++++++------ 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/new-framework-test.yml b/.github/workflows/new-framework-test.yml index 882dc87..4f58d8a 100644 --- a/.github/workflows/new-framework-test.yml +++ b/.github/workflows/new-framework-test.yml @@ -163,7 +163,7 @@ jobs: env: TEST_TYPE: "function_returns" - - name: Start upgrade compatibility tests + - name: Start upgrade compatibility tests task on background if: matrix.platform == 'linux' run: | log_dir="${WKDIR}/log/upgrade_compat" @@ -182,7 +182,7 @@ jobs: env: TEST_TYPE: "function" - - name: Wait upgrade compatibility tests finished + - name: Checking upgrade compatibility tests finished if: matrix.platform == 'linux' run: | pid_file="${WKDIR}/tmp/upgrade_compat.pid" @@ -195,15 +195,33 @@ jobs: fi pid=$(cat "$pid_file") - echo "[upgrade_compat] Waiting for process (PID: $pid) to finish..." + echo "[upgrade_compat] Streaming live output (PID: $pid)..." + + # Wait up to 60s for the log file to appear + waited=0 + while [ ! -f "$log_file" ] && [ $waited -lt 60 ]; do + sleep 1 + waited=$((waited + 1)) + done + + # Stream log in real-time via tail -f (background) + if [ -f "$log_file" ]; then + tail -f "$log_file" & + tail_pid=$! + fi + + # Wait for the main process to exit while kill -0 "$pid" 2>/dev/null; do - sleep 10 + sleep 5 done - echo "[upgrade_compat] Process completed." - echo "==================== upgrade_compat output ====================" - [ -f "$log_file" ] && cat "$log_file" || echo "(no log file found)" - echo "===============================================================" + # Give tail 1s to flush remaining output before killing it + sleep 1 + kill $tail_pid 2>/dev/null || true + wait $tail_pid 2>/dev/null || true + + echo "" + echo "[upgrade_compat] Process completed." if [ -f "$exit_file" ]; then ret=$(cat "$exit_file") From 40180bee817d61a4d0dc1083edb4bd8966fff627 Mon Sep 17 00:00:00 2001 From: taos-support Date: Fri, 20 Mar 2026 20:42:47 +0800 Subject: [PATCH 05/11] put old case and compatible case in one step --- .github/workflows/new-framework-test.yml | 104 ++++++++++------------- 1 file changed, 43 insertions(+), 61 deletions(-) diff --git a/.github/workflows/new-framework-test.yml b/.github/workflows/new-framework-test.yml index 4f58d8a..4f31508 100644 --- a/.github/workflows/new-framework-test.yml +++ b/.github/workflows/new-framework-test.yml @@ -163,71 +163,53 @@ jobs: env: TEST_TYPE: "function_returns" - - name: Start upgrade compatibility tests task on background - if: matrix.platform == 'linux' + - name: Run function and upgrade compatibility tests + if: matrix.platform == 'linux' || env.TARGET_BRANCH != '3.3.6' run: | log_dir="${WKDIR}/log/upgrade_compat" - mkdir -p "${WKDIR}/tmp" "$log_dir" + mkdir -p "$log_dir" + exit_file="${log_dir}/upgrade_compat_exit.txt" + compat_pid="" + + # + # Run compatible cases in background + # + http_base=$(echo "$extra_param" | grep -oE 'http://[^ ]+' || true) + rel_path="${log_dir#${WKDIR}/}" + log_url="${http_base}/${rel_path}/ci_output.log" + + compat_start=$(date +%s) + container_name="upgrade-compat-${PR_NUMBER:-0}_${GITHUB_RUN_NUMBER:-0}_${GITHUB_RUN_ATTEMPT:-0}" + echo "[upgrade_compat] START >>>>> cold/hot upgrade compatibility tests [$(date '+%Y-%m-%d %H:%M:%S')]" + echo "[upgrade_compat] Docker container name: ${container_name}" + ( - bash ${WKC}/test/ci/run_upgrade_compat.sh -w ${WKDIR} -l ${log_dir} -e \ - >> "${log_dir}/ci_output.log" 2>&1 - echo $? > "${WKDIR}/tmp/upgrade_compat_exit.txt" + set +e +o pipefail + bash ${WKC}/test/ci/run_upgrade_compat.sh -w ${WKDIR} -l ${log_dir} 2>&1 | \ + sed -u 's/^/[upgrade_compat] /' + echo ${PIPESTATUS[0]} > "$exit_file" ) & - echo $! > "${WKDIR}/tmp/upgrade_compat.pid" - echo "[upgrade_compat] Started in background, PID=$(cat ${WKDIR}/tmp/upgrade_compat.pid)" + compat_pid=$! + + + # + # Run function tests (foreground, blocking) + # + python3 test_runner.py + func_ret=$? + + if [ -n "$compat_pid" ]; then + wait $compat_pid 2>/dev/null || true + compat_ret=$(cat "$exit_file" 2>/dev/null || echo "1") + compat_end=$(date +%s) + elapsed=$((compat_end - compat_start)) + status="success" + [ "$compat_ret" != "0" ] && status="failure" + echo "[upgrade_compat] DONE <<<<< cold/hot upgrade compatibility tests [${elapsed}s] ${status}" + echo "[upgrade_compat] Log: ${log_url}" + fi - - name: Run function test cases - if: matrix.platform == 'linux' || env.TARGET_BRANCH != '3.3.6' - run: python3 test_runner.py + [ $func_ret -eq 0 ] || exit $func_ret + [ -z "$compat_pid" ] || [ "${compat_ret:-0}" -eq 0 ] || exit $compat_ret env: TEST_TYPE: "function" - - - name: Checking upgrade compatibility tests finished - if: matrix.platform == 'linux' - run: | - pid_file="${WKDIR}/tmp/upgrade_compat.pid" - exit_file="${WKDIR}/tmp/upgrade_compat_exit.txt" - log_file="${WKDIR}/log/upgrade_compat/ci_output.log" - - if [ ! -f "$pid_file" ]; then - echo "ERROR: upgrade compat was not started (no PID file found)" - exit 1 - fi - - pid=$(cat "$pid_file") - echo "[upgrade_compat] Streaming live output (PID: $pid)..." - - # Wait up to 60s for the log file to appear - waited=0 - while [ ! -f "$log_file" ] && [ $waited -lt 60 ]; do - sleep 1 - waited=$((waited + 1)) - done - - # Stream log in real-time via tail -f (background) - if [ -f "$log_file" ]; then - tail -f "$log_file" & - tail_pid=$! - fi - - # Wait for the main process to exit - while kill -0 "$pid" 2>/dev/null; do - sleep 5 - done - - # Give tail 1s to flush remaining output before killing it - sleep 1 - kill $tail_pid 2>/dev/null || true - wait $tail_pid 2>/dev/null || true - - echo "" - echo "[upgrade_compat] Process completed." - - if [ -f "$exit_file" ]; then - ret=$(cat "$exit_file") - echo "[upgrade_compat] Exit code: $ret" - exit $ret - else - echo "ERROR: no exit code file found, assuming failure" - exit 1 - fi From e1dd2bd2efd7bf680de9fa7ca4b6480d542af3e8 Mon Sep 17 00:00:00 2001 From: taos-support Date: Fri, 20 Mar 2026 21:05:23 +0800 Subject: [PATCH 06/11] fix: add linux --- .github/workflows/new-framework-test.yml | 35 ++++++++++++------------ 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/new-framework-test.yml b/.github/workflows/new-framework-test.yml index 4f31508..eb71b14 100644 --- a/.github/workflows/new-framework-test.yml +++ b/.github/workflows/new-framework-test.yml @@ -174,23 +174,24 @@ jobs: # # Run compatible cases in background # - http_base=$(echo "$extra_param" | grep -oE 'http://[^ ]+' || true) - rel_path="${log_dir#${WKDIR}/}" - log_url="${http_base}/${rel_path}/ci_output.log" - - compat_start=$(date +%s) - container_name="upgrade-compat-${PR_NUMBER:-0}_${GITHUB_RUN_NUMBER:-0}_${GITHUB_RUN_ATTEMPT:-0}" - echo "[upgrade_compat] START >>>>> cold/hot upgrade compatibility tests [$(date '+%Y-%m-%d %H:%M:%S')]" - echo "[upgrade_compat] Docker container name: ${container_name}" - - ( - set +e +o pipefail - bash ${WKC}/test/ci/run_upgrade_compat.sh -w ${WKDIR} -l ${log_dir} 2>&1 | \ - sed -u 's/^/[upgrade_compat] /' - echo ${PIPESTATUS[0]} > "$exit_file" - ) & - compat_pid=$! - + if [ "$CURRENT_PLATFORM" = "linux" ]; then + http_base=$(echo "$extra_param" | grep -oE 'http://[^ ]+' || true) + rel_path="${log_dir#${WKDIR}/}" + log_url="${http_base}/${rel_path}/ci_output.log" + + compat_start=$(date +%s) + container_name="upgrade-compat-${PR_NUMBER:-0}_${GITHUB_RUN_NUMBER:-0}_${GITHUB_RUN_ATTEMPT:-0}" + echo "[upgrade_compat] START >>>>> cold/hot upgrade compatibility tests [$(date '+%Y-%m-%d %H:%M:%S')]" + echo "[upgrade_compat] Docker container name: ${container_name}" + + ( + set +e +o pipefail + bash ${WKC}/test/ci/run_upgrade_compat.sh -w ${WKDIR} -l ${log_dir} 2>&1 | \ + sed -u 's/^/[upgrade_compat] /' + echo ${PIPESTATUS[0]} > "$exit_file" + ) & + compat_pid=$! + fi # # Run function tests (foreground, blocking) From 10d570bdf9a5af37af5edea00b3d5a86b9659f5a Mon Sep 17 00:00:00 2001 From: taos-support Date: Mon, 23 Mar 2026 09:26:56 +0800 Subject: [PATCH 07/11] fix: windows os run error --- .github/workflows/new-framework-test.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/new-framework-test.yml b/.github/workflows/new-framework-test.yml index eb71b14..3961e72 100644 --- a/.github/workflows/new-framework-test.yml +++ b/.github/workflows/new-framework-test.yml @@ -164,7 +164,7 @@ jobs: TEST_TYPE: "function_returns" - name: Run function and upgrade compatibility tests - if: matrix.platform == 'linux' || env.TARGET_BRANCH != '3.3.6' + if: (matrix.platform == 'linux' || env.TARGET_BRANCH != '3.3.6') && matrix.platform != 'windows' run: | log_dir="${WKDIR}/log/upgrade_compat" mkdir -p "$log_dir" @@ -199,6 +199,9 @@ jobs: python3 test_runner.py func_ret=$? + # + # wait compat tests finished and check result (if started) + # if [ -n "$compat_pid" ]; then wait $compat_pid 2>/dev/null || true compat_ret=$(cat "$exit_file" 2>/dev/null || echo "1") @@ -214,3 +217,10 @@ jobs: [ -z "$compat_pid" ] || [ "${compat_ret:-0}" -eq 0 ] || exit $compat_ret env: TEST_TYPE: "function" + + - name: Run function tests (Windows) + if: matrix.platform == 'windows' && env.TARGET_BRANCH != '3.3.6' + shell: cmd + run: python3 test_runner.py + env: + TEST_TYPE: "function" From 0cbd450bd24a9e63095eeebc20bd279a9501ad9a Mon Sep 17 00:00:00 2001 From: taos-support Date: Mon, 23 Mar 2026 18:25:47 +0800 Subject: [PATCH 08/11] fix: log url path --- .github/workflows/new-framework-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/new-framework-test.yml b/.github/workflows/new-framework-test.yml index 3961e72..689c351 100644 --- a/.github/workflows/new-framework-test.yml +++ b/.github/workflows/new-framework-test.yml @@ -166,7 +166,7 @@ jobs: - name: Run function and upgrade compatibility tests if: (matrix.platform == 'linux' || env.TARGET_BRANCH != '3.3.6') && matrix.platform != 'windows' run: | - log_dir="${WKDIR}/log/upgrade_compat" + log_dir="${WKDIR}/log/upgrade_compat/PR-${PR_NUMBER}_${GITHUB_RUN_NUMBER}_${GITHUB_RUN_ATTEMPT}" mkdir -p "$log_dir" exit_file="${log_dir}/upgrade_compat_exit.txt" compat_pid="" @@ -176,8 +176,8 @@ jobs: # if [ "$CURRENT_PLATFORM" = "linux" ]; then http_base=$(echo "$extra_param" | grep -oE 'http://[^ ]+' || true) - rel_path="${log_dir#${WKDIR}/}" - log_url="${http_base}/${rel_path}/ci_output.log" + rel_path="${log_dir#${WKDIR}/log/}" + log_url="${http_base}/${rel_path}/" compat_start=$(date +%s) container_name="upgrade-compat-${PR_NUMBER:-0}_${GITHUB_RUN_NUMBER:-0}_${GITHUB_RUN_ATTEMPT:-0}" From 699cde462fe85dfb1e94eb97061ded756a4499ae Mon Sep 17 00:00:00 2001 From: taos-support Date: Mon, 23 Mar 2026 20:32:43 +0800 Subject: [PATCH 09/11] fix: upgrade compat url add PR-NUM --- .github/workflows/new-framework-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/new-framework-test.yml b/.github/workflows/new-framework-test.yml index 689c351..b42caf7 100644 --- a/.github/workflows/new-framework-test.yml +++ b/.github/workflows/new-framework-test.yml @@ -176,8 +176,7 @@ jobs: # if [ "$CURRENT_PLATFORM" = "linux" ]; then http_base=$(echo "$extra_param" | grep -oE 'http://[^ ]+' || true) - rel_path="${log_dir#${WKDIR}/log/}" - log_url="${http_base}/${rel_path}/" + log_url="${http_base}/upgrade_compat/PR-${PR_NUMBER}_${GITHUB_RUN_NUMBER}_${GITHUB_RUN_ATTEMPT}" compat_start=$(date +%s) container_name="upgrade-compat-${PR_NUMBER:-0}_${GITHUB_RUN_NUMBER:-0}_${GITHUB_RUN_ATTEMPT:-0}" From cd2a795685f7530beb7bb7d748814ba47271a81b Mon Sep 17 00:00:00 2001 From: taos-support Date: Tue, 24 Mar 2026 12:28:16 +0800 Subject: [PATCH 10/11] remove cmd --- .github/workflows/new-framework-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/new-framework-test.yml b/.github/workflows/new-framework-test.yml index b42caf7..68bc90b 100644 --- a/.github/workflows/new-framework-test.yml +++ b/.github/workflows/new-framework-test.yml @@ -219,7 +219,6 @@ jobs: - name: Run function tests (Windows) if: matrix.platform == 'windows' && env.TARGET_BRANCH != '3.3.6' - shell: cmd run: python3 test_runner.py env: TEST_TYPE: "function" From 73aa891e5f4d9fbdad48a6436f8f250a1aac1d58 Mon Sep 17 00:00:00 2001 From: taos-support Date: Tue, 24 Mar 2026 12:58:25 +0800 Subject: [PATCH 11/11] ew-framework-test.yml@compat_branch -> branch main --- .github/workflows/new-framework-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/new-framework-test.yml b/.github/workflows/new-framework-test.yml index 68bc90b..774dbaf 100644 --- a/.github/workflows/new-framework-test.yml +++ b/.github/workflows/new-framework-test.yml @@ -109,7 +109,7 @@ jobs: uses: actions/checkout@v4 with: repository: "taosdata/.github" - ref: "compat_branch" + ref: "main" fetch-depth: 0 - name: Debug env