linrrzqqq opened a new pull request, #71341:
URL: https://github.com/apache/doris/pull/71341
### Background
`BitmapValue` chooses between `SINGLE` and `SET` representations based on
the global `config::enable_set_in_bitmap_value` flag (default `true`), and
selects serialization format v1/v2 via `config::bitmap_serialize_version`
(default `1`).
### What problem does this PR solve?
Issue Number: None
Related PR: None
PR Type: Test
Problem Summary:
`BitmapValueTest.bitmap_single_convert` expects `BitmapValue::SINGLE` and
`BitmapValue::BITMAP` transitions without disabling
`config::enable_set_in_bitmap_value`, so running it in isolation fails under
the default `true` setting (full-suite runs passed only because earlier tests
left the flag set to `false`). This PR saves and restores
`config::enable_set_in_bitmap_value` and `config::bitmap_serialize_version`
across bitmap unit tests so each test runs independently of execution order.
```text
Before (master):
Isolated run:
enable_set_in_bitmap_value = true (default)
-> bitmap_single_convert: bitmap.add(1) -> SET (3) != SINGLE (1) [FAIL]
Full-suite run:
earlier tests leave enable_set_in_bitmap_value = false (hardcoded)
-> bitmap_single_convert sees false -> SINGLE (1)
[masked]
After (this PR):
Every test saves original config values on entry and restores them on exit;
bitmap_single_convert explicitly sets enable_set_in_bitmap_value = false
and function_bitmap_to_base64 explicitly initializes
bitmap_serialize_version = 1.
```
### Details
Reproducer (isolated BE UT run):
```bash
./be/ut_build_ASAN/test/doris_be_test
--gtest_filter='BitmapValueTest.bitmap_single_convert'
```
Before:
```text
../test/core/value/bitmap_value_test.cpp:1531: Failure
Expected equality of these values:
BitmapValue::SINGLE
Which is: 1
bitmap._type
Which is: 3
```
After:
```text
[==========] Running 1 test from 1 test suite.
[ RUN ] BitmapValueTest.bitmap_single_convert
[ OK ] BitmapValueTest.bitmap_single_convert (0 ms)
[ PASSED ] 1 test.
```
### Testing
- Passed isolated single-process run for
`BitmapValueTest.bitmap_single_convert` and full suite run for
`BitmapValueTest.*:function_bitmap_test.*` (61/61 tests passed via
`run-be-ut.sh`).
- Passed 3 shuffled repeats
(`--gtest_filter="BitmapValueTest.*:function_bitmap_test.*" --gtest_shuffle
--gtest_repeat=3`, 61/61 tests passed per iteration).
### Release note
None.
### Check List (For Author)
- Behavior changed: No
- Does this need documentation: No
- Pre-submission status: Ready
### AI Disclosure
- Tool: Antigravity
- Generated: Test config save/restore edits and PR description draft
- Human review: Reviewed root cause, diff, and BE UT verification results
--
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]