diff --git a/cloud/script/run_all_tests.sh b/cloud/script/run_all_tests.sh index 71290198a7f365..466c2cb08136cd 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 f4ecb1d82f2b1b..bb2001f668228f 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 +}