yiguolei opened a new pull request, #70833: URL: https://github.com/apache/doris/pull/70833
### Background BE unit tests create files for readers, writers, caches, and child processes. These tests also run on shared development machines, where temporary artifacts can outlive a test process. ### What problem does this PR solve? Issue Number: None Related PR: #68494 (introduced ScopedTempDirectory) PR Type: Test Problem Summary: Fixed names under the system temporary directory can collide with another user's leftovers or with concurrent test runs, causing file creation or cleanup to fail. Move actual temporary artifacts into exclusively created `ScopedTempDirectory` roots and keep ownership alive until their readers, writers, and child processes finish. The broad diff applies the same ownership rule across 72 test files, including helpers that return paths and Python socket fixtures. ### Details - **Change map:** Tests: +701/-520 lines across 72 files. Production-source paths: +6/-0 lines in one header, entirely for a `BE_TEST` socket-prefix override; production behavior is unchanged. No generated files or documentation changes. - **Failure:** Opening or removing a fixed temporary path can fail when it is left behind by another user; concurrent tests can also truncate or remove each other's files. This is a source-traced failure scenario; its frequency and a before/after multi-user reproduction have not been measured. - **Cause:** Fixed names and ad-hoc PID/random suffixes do not establish exclusive directory ownership. Manual cleanup at the end of a test is also bypassed by fatal assertions. - **Stability evidence:** The affected tests now create artifacts beneath exclusively owned roots. All 1,679 test declarations are retained. The affected-suite run and its gaps are recorded below; this is not a repeated-run flakiness measurement. - **External dependencies:** Existing object-storage and real Kerberos tests require configured services and credentials. Their skips remain unchanged. ### Testing - Affected BE UT suites on a Linux development host, using `run-be-ut.sh`, ASAN, and `-j32` at `60aad551483`: 1,633 passed, 37 skipped, 0 failed (exit 0). This run excludes the 23 cases in `LanceTableReaderVectorSearchTest`. Skips comprise 34 external object-storage tests, one real Kerberos authentication test, and two microbenchmarks. - The original selection encountered looping Lance read failures. A separate diagnostic restored the Lance test file from baseline `d556f32bf8c`, adding error output and an early return on a failed read: 6 passed and 17 failed (exit 1). The installed Lance library reports `This operation is not supported for fragment scan`. This reproduces the failure without the temporary-directory changes in that test file; it is not a full baseline build comparison. Diagnostic edits were restored afterward. The full selection is not green. ### Notes for Reviewers - Fixture owners are declared before dependent resources. Path-returning factories retain function-local static directory ownership; helpers that consume a caller-owned root do not return paths into destroyed directories. - The `BE_TEST` Python socket prefix is shared across translation units so child arguments and readiness checks use the same owned directory. Production defaults and string-only path contracts are preserved. - Cleanup remains best effort; process crashes can still leave the current run's directory behind. ### Release note None ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Partially verified: external-service tests were skipped, and the separately diagnosed Lance baseline failures prevent a full-selection pass; multi-user collision and repeated-run stability were not exercised. ### AI Disclosure - Tool: Codex (GPT-6) - Generated: Test migration, validation analysis, and this description. - Human review: Not stated. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
