Description
LocalFileSystemTest.TestGlob hardcodes the path ./be/ut_build_ASAN/test/file_path/, which only works when building with CMAKE_BUILD_TYPE=ASAN. On other build types (LSAN, TSAN, UBSAN, etc.), the test directory is ./be/ut_build_LSAN/test/file_path/ (or similar), causing safe_glob to fail because the files are created in a non-existent path.
Error output
[ RUN ] LocalFileSystemTest.TestGlob
../test/io/fs/local_file_system_test.cpp:435: Failure
Value of: io::global_local_filesystem()->safe_glob("./file_path/1/*.txt", &files).ok()
Actual: false
Expected: true
../test/io/fs/local_file_system_test.cpp:436: Failure
Expected equality of these values:
2
files.size()
Which is: 0
../test/io/fs/local_file_system_test.cpp:438: Failure
Value of: io::global_local_filesystem()->safe_glob("./file_path/*/*.txt", &files).ok()
Actual: false
Expected: true
../test/io/fs/local_file_system_test.cpp:439: Failure
Expected equality of these values:
2
files.size()
Which is: 0
[ FAILED ] LocalFileSystemTest.TestGlob (120 ms)
Root cause
The test hardcodes ./be/ut_build_ASAN/test/file_path/ as the base path. run-be-ut.sh constructs the build directory as ${DORIS_HOME}/be/ut_build_${CMAKE_BUILD_TYPE}, so the path varies by build type. On LSAN builds, the actual path is ./be/ut_build_LSAN/test/file_path/, and the hardcoded ASAN path doesn't exist.
How to reproduce
Run BE unit tests with a non-ASAN build type, e.g.:
BUILD_TYPE_UT=LSAN ./run-be-ut.sh --run
Description
LocalFileSystemTest.TestGlobhardcodes the path./be/ut_build_ASAN/test/file_path/, which only works when building withCMAKE_BUILD_TYPE=ASAN. On other build types (LSAN, TSAN, UBSAN, etc.), the test directory is./be/ut_build_LSAN/test/file_path/(or similar), causingsafe_globto fail because the files are created in a non-existent path.Error output
Root cause
The test hardcodes
./be/ut_build_ASAN/test/file_path/as the base path.run-be-ut.shconstructs the build directory as${DORIS_HOME}/be/ut_build_${CMAKE_BUILD_TYPE}, so the path varies by build type. On LSAN builds, the actual path is./be/ut_build_LSAN/test/file_path/, and the hardcoded ASAN path doesn't exist.How to reproduce
Run BE unit tests with a non-ASAN build type, e.g.: