Skip to content

[fix](test) Fix TestGlob hardcoded ASAN path incompatible with non-ASAN builds#64213

Open
heguanhui wants to merge 1 commit into
apache:masterfrom
heguanhui:fix/fix-glob-path-ut-issue-for-non-asan
Open

[fix](test) Fix TestGlob hardcoded ASAN path incompatible with non-ASAN builds#64213
heguanhui wants to merge 1 commit into
apache:masterfrom
heguanhui:fix/fix-glob-path-ut-issue-for-non-asan

Conversation

@heguanhui
Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #64212

Problem Summary: 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.

run-be-ut.sh sets DORIS_HOME to ${CMAKE_BUILD_DIR}/test/ at runtime (line 556), which already adapts to each build type. Use getenv("DORIS_HOME") to construct the path dynamically instead of hardcoding the ASAN-specific path.

Release note

None

Check List (For Author)

  • Test: Unit Test
  • Behavior changed: No
  • Does this need documentation: No

…AN builds

### What problem does this PR solve?

Issue Number: close #xxx

Problem Summary: LocalFileSystemTest.TestGlob hardcodes the path
`./be/ut_build_ASAN/test/file_path/` for creating test files, but
`safe_glob()` looks up files under `config::user_files_secure_path`
(which resolves to `${DORIS_HOME}/test/`). In ASAN mode these paths
happen to coincide, so the test passes. In LSAN or other non-ASAN
builds, ${DORIS_HOME} differs while files are still created under the
hardcoded ASAN path, causing the glob to find nothing and the test to
fail.

Fix by using `getenv("DORIS_HOME")` to construct the test directory
and explicitly setting `config::user_files_secure_path` to match,
with save/restore to avoid polluting other tests.

### Release note

None

### Check List (For Author)

- Test: Unit Test
- Behavior changed: No
- Does this need documentation: No
@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@heguanhui
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.90% (28302/38298)
Line Coverage 57.93% (308095/531853)
Region Coverage 54.60% (257350/471332)
Branch Coverage 56.11% (111896/199431)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants