Skip to content

[fix](cloud) Ignore libfdb ASAN failures in cloud UT runner#65749

Merged
gavinchou merged 1 commit into
apache:masterfrom
gavinchou:gavin-fix-cloud-ut-asan
Jul 17, 2026
Merged

[fix](cloud) Ignore libfdb ASAN failures in cloud UT runner#65749
gavinchou merged 1 commit into
apache:masterfrom
gavinchou:gavin-fix-cloud-ut-asan

Conversation

@gavinchou

Copy link
Copy Markdown
Contributor

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 -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

@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?

@gavinchou

Copy link
Copy Markdown
Contributor Author

run buildall

@gavinchou

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: request changes

I found one blocking correctness issue in the new ASAN waiver: it can report a successful cloud-UT run when gtest failed or did not finish, and its log-wide signature can also absorb a Doris-owned sanitizer error. See the inline comment for the concrete scenarios and fix direction.

Checkpoint conclusions:

  • Goal and proof: The test binary still runs and PIPESTATUS[0] is preserved, but the selective waiver is not safe. bash -n passed; controlled mixed-failure reproductions returned success; no repository-owned test covers the classifier.
  • Scope and parallel paths: The runner change is small and stopwatch_test.cpp is a semantic no-op. Normal, binary-filtered, gtest-filtered, and coverage runs share the reviewed path; gdb bypass is unchanged.
  • Lifecycle, concurrency, and errors: There is no new runner-level concurrency or locking. The critical lifecycle boundary is active gtest execution versus process teardown, which the patch does not distinguish. Ordinary first-failure aggregation is correct, but the waiver violates the error-means-failure invariant.
  • Compatibility, configuration, persistence, data writes, and FE/BE propagation: Not applicable.
  • Observability and performance: tee retains full CI output and the waiver names the binary; temporary capture introduces no separate blocking issue.
  • Validation limits: Static inspection, bash -n, ShellCheck, and controlled shell reproductions only; no build or cloud UT run was attempted, per the review-runner instruction.
  • User focus: No additional user-provided focus was supplied.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline anchor correction for review 4719636680; the full request-changes summary remains on that review.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch can make the runner pass without proving that the selected gtests completed and passed. A real [ FAILED ] result followed by the documented exit-time FDB crash still has its nonzero status reset here; moreover, Transaction::init() calls fdb_transaction_set_option during active tests, so even that exact signature can occur before the current case or remaining cases complete. The two whole-log greps can also pair a Doris-owned ASAN report with an unrelated libfdb_c.so mention. Please waive only after the fresh ${i}.xml proves all selected tests completed with zero failures/errors and the ASAN report matches the narrow known fault frame; keep missing/incomplete XML or any other sanitizer report nonzero, and add runner tests for these mixed cases.

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.62% (1908/2458)
Line Coverage 64.46% (34141/52966)
Region Coverage 64.90% (17571/27076)
Branch Coverage 54.04% (9416/17424)

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Jul 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@gavinchou
gavinchou merged commit f21a72e into apache:master Jul 17, 2026
34 checks passed
github-actions Bot pushed a commit that referenced this pull request Jul 17, 2026
## 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 <gavinchou@apache.org>
yiguolei pushed a commit that referenced this pull request Jul 20, 2026
#65749 (#65774)

Cherry-picked from #65749

Co-authored-by: Gavin Chou <gavin@selectdb.com>
Co-authored-by: gavinchou <gavinchou@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/4.1.4-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants