apache / apache/doris

[bug](be) LocalFileSystemTest.TestGlob fails on non-ASAN builds due to hardcoded path

Open
#64,212 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
15.9k
Forks
3.9k
Avg merge
2d 23h
Merged PRs (30d)
520

Description

### 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.:
```bash
BUILD_TYPE_UT=LSAN ./run-be-ut.sh --run
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.