morningman opened a new pull request, #71381: URL: https://github.com/apache/doris/pull/71381
### Background The BE unit tests run in one GoogleTest process in CI. Fixtures share process-level caches, signal dispositions, and temporary index directories through `ExecEnv` and other globals. Mac builds also use a different C library and C++ standard library from the default Linux build. ### What problem does this PR solve? Issue Number: #71314 Related PR: #71328 (unique backend IDs for test storage engines), #71332 (deterministic file-cache fixtures), #71315 (integration branch), apache/doris-thirdparty#446 (ORC timezone test) PR Type: Test Problem Summary: Some BE tests depend on which suite ran first, whether a background worker has started, or which platform runs the binary. For example, `BlockFileCacheTest.fd_cache_remove` expected two readers and counted 52 when it shuffled after cases that left descriptors behind. Give the fixtures control of the state they use, wait for the conditions their assertions require, and select portable inputs or platform-specific expectations where needed. The test fixes run with the existing GoogleTest runner and fixture conventions. ### Details - **Change map:** Test files +862/-433 and the ORC pin +1/-1. The ORC pin advances from `d88650dcd09` to `f346be42a52` and brings in one writer-test commit. The following table follows the commits in review order. | Commit | Test change | Lines | | --- | --- | ---: | | [`acb95c76136`](https://github.com/morningman/doris/commit/acb95c7613686d072da971454d37741915e73190) | Compare the Kerberos ticket cache path with the canonical test dir | +4/-2 | | [`1f71968ba05`](https://github.com/morningman/doris/commit/1f71968ba055898bff421b0dd7f8396b9372b8ef) | Keep the BSON allocation hook off thread_local storage | +16/-5 | | [`20ecc7bc3a9`](https://github.com/morningman/doris/commit/20ecc7bc3a9275cf1feb879e3a7803828b30e82a) | Match the DCHECK in the ScoreRuntime death test | +3/-1 | | [`2916d7086bd`](https://github.com/morningman/doris/commit/2916d7086bde682b30d07424195243fea50b159f) | Keep a copy of DORIS_HOME in UserFunctionCacheTest | +8/-4 | | [`3ae569f5791`](https://github.com/morningman/doris/commit/3ae569f57914c43882268753f29743ccc5a72310) | Expect missing index data for an empty VARIANT values index | +2/-1 | | [`bb9783a07ad`](https://github.com/morningman/doris/commit/bb9783a07adcb02a479187224454805a76c0990e) | Give SIGPIPE a no-op handler in HttpClientTlsTest | +12/-0 | | [`f2c12b55b80`](https://github.com/morningman/doris/commit/f2c12b55b808d4ef23c98b1ed3e782d8dcf37b59) | Stop relying on /bin/true in BE unit tests | +4/-2 | | [`c3dd50c1184`](https://github.com/morningman/doris/commit/c3dd50c1184cf099e18245da06e91dfe86c25761) | Wait for the delayed load streams to drain in the incremental close race test | +8/-2 | | [`6cf776a5fbe`](https://github.com/morningman/doris/commit/6cf776a5fbef024421b493b168943eb253a442bd) | Wait for the segcompaction to run before building in FatalSegcompactionFailsBuild | +10/-2 | | [`af6bda0e92f`](https://github.com/morningman/doris/commit/af6bda0e92febcd63a8a9db5b67c0cab20036e3c) | Remove the storage engine that the delete bitmap calculator tests install | +4/-0 | | [`521bbae2c6a`](https://github.com/morningman/doris/commit/521bbae2c6a38250cd5eebf793ad3d9cde509774) | Check MetadataAdder sizes relative to the starting total | +14/-12 | | [`621f8246a87`](https://github.com/morningman/doris/commit/621f8246a87ab82fb3bca1843d09a87f3542f721) | Retry the inode total checks until a statvfs read matches | +49/-21 | | [`b89fa33749c`](https://github.com/morningman/doris/commit/b89fa33749c38fd806f1fb69538267764b183b54) | Wait for the compaction threads to start in TestSubmitCompactionTask | +18/-4 | | [`c8f9b3f9c40`](https://github.com/morningman/doris/commit/c8f9b3f9c40eb36e71ad9cd3595eaf74b43a3b8a) | Wait for the file cache to finish opening before the tests write to it | +21/-0 | | [`1a2daaac2f0`](https://github.com/morningman/doris/commit/1a2daaac2f08899151b3bd9d021ae75a1c277a2a) | Serve a file the test writes itself in HttpClientTest.download_file_md5 | +21/-3 | | [`522ec4bac1f`](https://github.com/morningman/doris/commit/522ec4bac1f6b1d24a4e63c1d8dd7529c0c15451) | Restore the SIGCHLD disposition after each CdcClientMgrTest case | +10/-1 | | [`1f844b402ae`](https://github.com/morningman/doris/commit/1f844b402ae942e9aea175f276a57916b039a454) | Run PythonServerTest's fake servers with an installed interpreter | +75/-157 | | [`b27f81689bc`](https://github.com/morningman/doris/commit/b27f81689bc2fa7c0c4df7e9642a2ce8ed9e955f) | Accept one ulp in the libm results of MathFunctionTest | +80/-30 | | [`e1bf4767104`](https://github.com/morningman/doris/commit/e1bf4767104484bb90753966c99c92706c0145d1) | Freeze AnnWriteGolden's HNSW digests for libc++ builds separately | +43/-2 | | [`c335f588067`](https://github.com/morningman/doris/commit/c335f58806749eb88edf2406e262c4be92bd28fe) | Update apache-orc for its timezone writer test without setenv("TZ") | +1/-1 | | [`562d71afbcf`](https://github.com/morningman/doris/commit/562d71afbcf160687b13d6b676c504580019b9c2) | Put back the process-wide TmpFileDirs that BE unit tests replace | +237/-41 | | [`25c30f7ea77`](https://github.com/morningman/doris/commit/25c30f7ea77269a3f0292d53374739b04e55c5cb) | Keep DataTypeJsonbSerDeTest.ArrowMemNotAligned off the suite's shared column | +6/-2 | | [`e3447dab473`](https://github.com/morningman/doris/commit/e3447dab4738be8fac388c299f49b0f1fdfe58dd) | Let S3FileWriterTest.write_buffer_boundary put the suite's S3 mocks back | +13/-1 | | [`8805ba797f2`](https://github.com/morningman/doris/commit/8805ba797f244527ba7e929cd34b40a3ae6fff0e) | Give every BlockFileCacheTest case an empty FD cache | +10/-0 | | [`121670af06a`](https://github.com/morningman/doris/commit/121670af06a9e962987c026f23a16b8cecc285a2) | Check what reader_dryrun_when_download_file_cache adds to the dry-run counter | +4/-1 | | [`8024f52ff4b`](https://github.com/morningman/doris/commit/8024f52ff4b35594962635a82049f7099024b9e7) | Track the entries CacheLRUDumperTest's mock cache restores per cache | +5/-3 | | [`5a1d4a830ff`](https://github.com/morningman/doris/commit/5a1d4a830ffe0f1e3729cbb78517c9f7d86565cb) | Give each ConfigTest case its own config dump | +14/-2 | | [`664cc9704c4`](https://github.com/morningman/doris/commit/664cc9704c49578bf6e2f96ee123da32370ec2c4) | Stop BE unit tests from rewriting tablet schemas shared through the schema cache | +31/-11 | | [`b36da8a6e8b`](https://github.com/morningman/doris/commit/b36da8a6e8b1d68ed1d7244b31ac8abd2030fd1b) | Put back the inverted index searcher cache that IndexBuilderTest replaces | +11/-2 | | [`67534ed04f0`](https://github.com/morningman/doris/commit/67534ed04f0042b4de3c544aa59f3cf8a0c0618d) | Take the ids of the rowsets IndexBuilderTest writes from its storage engine | +37/-55 | | [`1558be86c39`](https://github.com/morningman/doris/commit/1558be86c3926bf2c039f5c73e4dacc14a1c10cd) | Uninstall the searcher cache SegmentCorruptionTest installs before freeing it | +7/-0 | | [`66910509cfe`](https://github.com/morningman/doris/commit/66910509cfef011df6ed1f972f7987cbf3d003ad) | Give SegmentCorruptionTest's segments rowset ids from the engine | +3/-6 | | [`3c54455b9a7`](https://github.com/morningman/doris/commit/3c54455b9a766c19d9b5ebe22650f864165ebc0b) | Register ConfigTest's fields on every run of a case | +34/-20 | | [`2ef33cfa92e`](https://github.com/morningman/doris/commit/2ef33cfa92e8a4481c670c99cd06e6b6d8ce53ec) | Give SegmentCorruptionTest a file cache factory of its own | +21/-20 | | [`9777dd477c5`](https://github.com/morningman/doris/commit/9777dd477c5507448489fc6e5730cd74149875b0) | Put back the file cache factory FileCacheActionTest replaces before freeing it | +20/-13 | | [`29e2a847072`](https://github.com/morningman/doris/commit/29e2a847072675e4fecfc91f8803cf581d4696a2) | Stop cache tests when fixture startup fails | +6/-7 | | [`7d2e638740e`](https://github.com/morningman/doris/commit/7d2e638740ecf7c54b6e831132b009d485656d94) | Give segment compaction cases their own batch size | +7/-6 | - **Failure:** The FD-cache counts and cache-backed index tests failed after other cases left entries or freed objects behind. Standalone delete-bitmap suites could pass their assertions and then abort during process shutdown. Other cases failed when the platform lacked `/bin/true`, reported a different libm result within one ULP, or produced a different HNSW digest. - **Cause:** Several fixtures used process-wide state without owning or restoring it. Timing cases assumed workers had run or that successive filesystem samples agreed. Platform-sensitive fixtures assumed Linux paths, rounding, or C++ heap behavior. - **Stability evidence:** Earlier ASAN probes exercised the freed searcher-cache pointer and confirmed it was restored by the fixture. Forced compaction start delays reproduced the early assertion against zero executing tasks. The inode tests still fail against a mutation that returns the available count as the total. The initial seed-48256 run exposed a segment compaction fixture that inherited batch size 3 and wrote 11 segments. After the fixture set its batch size and restored its settings, the same case passed in the same order with its original seven-segment assertion. ### Testing - macOS arm64 ASAN with Clang 22, `./run-be-ut.sh --run -j 6 --filter <affected suites>`. Registration order and shuffle with seed 48256 each ran the same 1,755 cases from 112 suites, with 1,746 passes and nine skips. - Two repetitions of 17 focused cases covered config registration, cache restore, index builder and segment corruption. Separate runs passed both MetadataAdder cases and confirmed that both delete-bitmap calculator suites exit normally. - Clang-format 16, header hygiene, changed-line clang-tidy and `git diff --check` passed. Master advanced after the ASAN runs. The rebase changed only FE, Docker fixtures and regression tests relative to the tested tree. ### Notes for Reviewers - #71328 supplies distinct engine IDs. The index builder and segment fixtures take rowset IDs from their engines so cache keys can distinguish their fixtures. - The libm tolerance applies only to the selected Float64 cases. The existing libstdc++ HNSW reference remains in the golden file alongside the arm64 libc++ digest. ### Release note None ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Partially verified: Linux BE unit test CI pending. ### AI Disclosure - Tool: Claude Code (Claude Opus 5.5) and OpenAI Codex (GPT-6) - Generated: Claude wrote the original test fixes. Codex prepared the split, propagated cache setup assertions, isolated the segment compaction settings, and wrote the 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]
