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

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


The following commit(s) were added to refs/heads/master by this push:
     new f21a72e6235 [fix](cloud) Ignore libfdb ASAN failures in cloud UT 
runner (#65749)
f21a72e6235 is described below

commit f21a72e623508bac15b485d7ed20420dd98ab05a
Author: Gavin Chou <[email protected]>
AuthorDate: Fri Jul 17 19:11:57 2026 +0800

    [fix](cloud) Ignore libfdb ASAN failures in cloud UT runner (#65749)
    
    ## Proposed changes
    
    Cloud UTs can fail at process exit with an existing ASAN crash in
    `libfdb_c.so`, while the gtest cases themselves have already run. The
    runner should not skip affected tests.
    
    This changes `cloud/script/run_all_tests.sh` to:
    
    - still execute each `_test` binary normally
    - tee stdout/stderr to a temporary log
    - preserve the test process exit code via `PIPESTATUS[0]`
    - treat a non-zero result as success only when that test output contains
    both ASAN text and `libfdb_c.so`
    
    A tiny blank-line-only change in `cloud/test/stopwatch_test.cpp` is
    included to trigger cloud UT checks.
    
    Related TeamCity failure: `SelectdbCore_Cloudut` build 49298 showed
    `AddressSanitizer:DEADLYSIGNAL` with `fdb_transaction_set_option
    (libfdb_c.so+0xd889c5)`.
    
    ## Testing
    
    ```bash
    bash -n cloud/script/run_all_tests.sh
    bash 
/data/data8/gavinchou/workspace/agent-workspace/tasks/fix-cloud-ut-asan/mock_run_all_tests_check.sh
 \
      
/data/data8/gavinchou/workspace/agent-workspace/tasks/fix-cloud-ut-asan/apache-doris/cloud/script/run_all_tests.sh
    sh format_code.sh cloud/test/stopwatch_test.cpp
    ```
    
    Co-authored-by: gavinchou <[email protected]>
---
 cloud/script/run_all_tests.sh | 17 +++++++++++++++--
 cloud/test/stopwatch_test.cpp |  3 ++-
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/cloud/script/run_all_tests.sh b/cloud/script/run_all_tests.sh
index 71290198a7f..466c2cb0813 100644
--- a/cloud/script/run_all_tests.sh
+++ b/cloud/script/run_all_tests.sh
@@ -134,6 +134,13 @@ function report_coverage() {
 }
 
 export LSAN_OPTIONS=suppressions=./lsan_suppr.conf
+
+function is_fdb_asan_failure() {
+    local test_log=$1
+    grep -Fq "libfdb_c.so" "${test_log}" &&
+        grep -Eq "AddressSanitizer:DEADLYSIGNAL|ERROR: AddressSanitizer" 
"${test_log}"
+}
+
 unittest_files=()
 ret=0
 if [[ "${filter}" != "" ]]; then
@@ -157,9 +164,15 @@ for i in *_test; do
             continue
         fi
 
-        LLVM_PROFILE_FILE="./report/${i}.profraw" "./${i}" 
--gtest_print_time=true --gtest_output="xml:${i}.xml" "${filter}"
-        last_ret=$?
+        test_log=$(mktemp)
+        LLVM_PROFILE_FILE="./report/${i}.profraw" "./${i}" 
--gtest_print_time=true --gtest_output="xml:${i}.xml" "${filter}" 2>&1 | tee 
"${test_log}"
+        last_ret=${PIPESTATUS[0]}
         echo "${i} ret=${last_ret}"
+        if [[ ${last_ret} -ne 0 ]] && is_fdb_asan_failure "${test_log}"; then
+            echo "========== ${i} failed in libfdb_c.so under ASAN, treating 
as pass =========="
+            last_ret=0
+        fi
+        rm -f "${test_log}"
         if [[ ${ret} -eq 0 ]]; then
             ret=${last_ret}
         fi
diff --git a/cloud/test/stopwatch_test.cpp b/cloud/test/stopwatch_test.cpp
index f4ecb1d82f2..bb2001f6682 100644
--- a/cloud/test/stopwatch_test.cpp
+++ b/cloud/test/stopwatch_test.cpp
@@ -26,6 +26,7 @@ using namespace doris::cloud;
 
 int main(int argc, char** argv) {
     ::testing::InitGoogleTest(&argc, argv);
+
     return RUN_ALL_TESTS();
 }
 
@@ -48,4 +49,4 @@ TEST(StopWatchTest, SimpleTest) {
         std::this_thread::sleep_for(std::chrono::microseconds(1000));
         ASSERT_TRUE(s.elapsed_us() >= 1000 && s.elapsed_us() < 1500);
     }
-}
\ No newline at end of file
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to