Skip to content

[test](be) Fix or remove the unit tests excluded from the BE build - #68486

Open
csun5285 wants to merge 1 commit into
apache:masterfrom
csun5285:test/restore-page-encoding-ut
Open

csun5285 wants to merge 1 commit into
apache:masterfrom
csun5285:test/restore-page-encoding-ut

Conversation

@csun5285

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

### What problem does this PR solve?

Issue Number: None

Related PR: apache#16022, apache#20461, apache#51418, apache#61092, apache#67171

Problem Summary:

be/test/CMakeLists.txt keeps a "todo: need fix those ut" list of tests that
are not built. Most of them stopped building years ago, so they have not run
since and no longer match the code. This change fixes or removes each of them.

Ported and built again:
- plain, bitshuffle, binary plain, binary prefix and RLE page tests. They used
  ColumnBlock/ColumnBlockView, which apache#16022 removed. They now create builders
  with PageBuilderHelper::create() and read pages into a MutableColumnPtr.
  binary_prefix_page_test already had a copy of its test on the column API, so
  the ColumnBlock copy is removed.
- column_reader_writer_test, ported to the column API. It also needed:
  - seek_to_ordinal(0) before the sequential read. apache#51418 removed
    seek_to_first() and dropped the calls without a replacement, so the read
    crashed on a null ordinal index iterator.
  - precision 27 and frac 9 in the DECIMAL column meta, because ColumnWriter
    now builds a data type from the meta.
  - valid DATETIME values, because reading checks them.
  - CHAR is now read back without its trailing '\0' padding.
  - The BITMAP default value case is removed. DefaultValueColumnIterator can
    not parse a BITMAP default value from a string any more.
- segment_iterator_apply_index_expr_test, excluded since apache#61092 added it.
  apache#67171 later made _apply_index_expr() skip virtual columns when _row_bitmap
  is empty. The fixture never filled it, so 7 of 11 cases failed. The fixture
  now selects every row, like _lazy_init() does.
- config_validator_test. Its config with an invalid default broke
  config::init() when the test binary starts, and the test reset every config.
  The defaults are valid now, and the validator is checked by loading a conf
  file with set_to_default=false, which only touches the configs in the file.
- metrics_action_test. It redefined HttpChannel::send_reply(), which clashes
  with the real one. It now starts an EvHttpServer and reads the response with
  HttpClient.
- large_int_value_test. Its suite name clashed with
  core/value/large_int_value_test.cpp. The two boundary cases move there, and
  the benchmark that loops 10M times is dropped.

Duplicate cases are dropped while porting:
- The Equal and Sequence plain page cases. PLAIN only copies memory, so the
  shape of the data does not matter and the Random cases cover them.
- test_v_default_value. The ported test_default_value covers more types and
  also seeks.
- MetricsActionTest.prometheus_no_prefix. It only checks the registry output
  format, which metrics_test already covers.

Removed:
- heartbeat_server_test, decimal_value_test, decompress_test and
  url_coding_test. The code they test is gone or never matched their API.
- remote_file_system_test and remote_rowset_gc_test. They need a real
  S3/HDFS/broker, were DISABLED since they were added, and call APIs that no
  longer exist.
- The runtime/jsonb_value_test.cpp entry. The file moved to core/value and
  already runs.

frame_of_reference_page_test stays excluded. FrameOfReferencePageDecoder can
not read pages with next_batch(), and seeking backward throws since apache#53675.

Two headers did not compile on their own, and the page tests include them
first. page_decoder.h now includes storage/olap_define.h for
DISALLOW_COPY_AND_ASSIGN, and rle_page.h includes storage/types.h for
TypeTraits. No behavior change.

rle_page_test has one NOLINT for clang-analyzer-optin.cplusplus.VirtualCall.
It is a false positive: the analyzer reports uninitialized fields in the
RlePageDecoder constructor and then treats the decoder as still being built.

### Release note

None

### Check List (For Author)

- Test: Unit Test
    - PlainPageTest, BitShufflePageTest, BinaryPlainPageTest,
      BinaryPrefixPageTest, RlePageTest, ColumnReaderWriterTest,
      SegmentIteratorApplyIndexExprTest, ConfigValidatorTest,
      MetricsActionTest, LargeIntValueTest
    - Related suites: BinaryDictPageTest, BinaryPlainPageV2Test,
      BinaryPlainPageV3Test, ColumnReaderCacheTest, EncodingInfoTest,
      ColumnReaderTest, ConfigTest, JsonBinaryValueTest
    - 18 suites, 186 cases, all passed
- Behavior changed: No
- Does this need documentation: No

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@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?

@csun5285

Copy link
Copy Markdown
Contributor Author

run buildall

@csun5285

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.

Request changes: two issues are called out inline.

Critical checkpoint conclusions:

  • Goal and test proof: the PR mostly reactivates or removes the excluded BE tests, but it deletes the only focused specification of the still-live remote-tablet-GC marker-to-directory cleanup lifecycle instead of moving it onto the existing hermetic remote-filesystem mock.
  • Scope, build, and compatibility: the changes are focused on test migration/removal plus two header self-containment fixes. The CMake glob includes each surviving restored source once, no duplicate GoogleTest or externally linked helper collision was found, and there is no runtime configuration, FE/BE protocol, storage-format, transaction, or persistence change. The broad olap_define.h dependency reaches only one additional TU through this edge and is not a blocking issue.
  • Data correctness and parallel paths: the migrated page-decoder and vectorized-column representations match their production contracts. Active schema-change regressions exercise the BITMAP-default and nullable-default production paths end to end, so those earlier direct-unit concerns were dismissed rather than reported.
  • Concurrency and lifecycle: the changed fixtures restore shared flags, isolate filesystem state, use an ephemeral HTTP port, and destroy the server before its stack handler; no production concurrency issue was found. The remote-GC deletion remains a coverage defect because no remaining test observes remote directory deletion or success-only marker cleanup.
  • Determinism and performance: the reactivated metrics endpoint test fixes output order from multiple std::unordered_map instances, making a semantically correct response toolchain-dependent. No other material performance or determinism issue was substantiated.
  • Validation: this review was static only, as required; I did not run builds or tests. At submission time COMPILE, formatting, Checkstyle, license, and secret checks pass, while BE UT, regression, cloud regression, and performance jobs remain pending. The PR checklist does not record author-run validation. No user-specific focus points were supplied.

The review completed three rounds and converged at exact head 270f1d142f62d4bc11523ac23f516901200bf67e; all other candidates were deduplicated or dismissed with code/test evidence.


st = k_engine->tablet_manager()->drop_tablet(10005, 0, true);
ASSERT_EQ(Status::OK(), st);
tablet->data_dir()->perform_remote_tablet_gc();

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.

Preserve the live remote-tablet-GC lifecycle coverage.

Please port this lifecycle case to a hermetic backend instead of deleting it. Although the file was excluded before this PR, it is still the only specification of the live drop -> REMOTE_TABLET_GC_PREFIX marker -> perform_remote_tablet_gc() -> remote data/<tablet_id> deletion path, including success-only marker cleanup. No remaining test asserts either the marker or this GC entry point, and tablet_cooldown_test.cpp already provides a local-backed RemoteFileSystemMock with delete_directory_impl, so the scenario can be preserved without S3/HDFS/broker dependencies.

put_requests_total->increment(2345);

s_expect_response =
EXPECT_EQ(

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.

Make the Prometheus comparison independent of unordered-map iteration.

MetricRegistry::to_prometheus() emits an EntityMetricsByType std::unordered_map, and labels_to_string() directly iterates Labels, another std::unordered_map; this string fixes both metric-group order and the path,type label order. A different standard-library bucket order can fail the reactivated test while producing equivalent Prometheus output. Please parse or normalize the response, or compare complete samples and labels order-insensitively while still checking that no unexpected lines are present.

@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 76.37% (34406/45051)
Line Coverage 61.30% (386665/630750)
Region Coverage 57.69% (325700/564567)
Branch Coverage 58.53% (148499/253714)

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 27602 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 270f1d142f62d4bc11523ac23f516901200bf67e, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17593	3914	3840	3840
q2	2144	360	300	300
q3	10101	1398	789	789
q4	4685	483	347	347
q5	7457	825	542	542
q6	179	174	139	139
q7	739	779	602	602
q8	9308	1467	1567	1467
q9	5459	4193	4131	4131
q10	6827	1325	1007	1007
q11	428	269	240	240
q12	630	421	289	289
q13	18089	2613	1988	1988
q14	261	254	229	229
q15	q16	734	713	656	656
q17	1832	1186	911	911
q18	6444	5595	5521	5521
q19	1333	1192	974	974
q20	474	391	265	265
q21	5874	3204	3052	3052
q22	427	362	313	313
Total cold run time: 101018 ms
Total hot run time: 27602 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4526	4471	4474	4471
q2	735	576	525	525
q3	4725	5362	4579	4579
q4	2201	2350	1472	1472
q5	4568	4497	4405	4405
q6	235	178	133	133
q7	1838	1749	1513	1513
q8	2376	2008	2048	2008
q9	7352	7132	6908	6908
q10	3612	3549	3080	3080
q11	513	389	348	348
q12	731	697	501	501
q13	2261	2597	2003	2003
q14	266	273	253	253
q15	q16	663	694	594	594
q17	7230	6665	6636	6636
q18	11899	11061	11772	11061
q19	1102	999	1008	999
q20	2204	2186	1887	1887
q21	4942	4202	4259	4202
q22	505	454	417	417
Total cold run time: 64484 ms
Total hot run time: 57995 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 152098 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 270f1d142f62d4bc11523ac23f516901200bf67e, data reload: false

query5	4314	625	454	454
query6	434	207	196	196
query7	4826	538	296	296
query8	321	170	159	159
query9	8806	3962	3957	3957
query10	419	320	250	250
query11	5848	3515	3219	3219
query12	151	88	84	84
query13	1255	600	421	421
query14	6502	4496	4227	4227
query14_1	3965	3992	4042	3992
query15	205	198	181	181
query16	992	458	429	429
query17	920	674	546	546
query18	2446	454	341	341
query19	208	183	159	159
query20	82	80	79	79
query21	222	133	118	118
query22	13149	12969	12796	12796
query23	13904	12872	12492	12492
query23_1	12463	12525	12698	12525
query24	7282	1114	635	635
query24_1	664	689	693	689
query25	558	437	375	375
query26	981	301	178	178
query27	2682	557	328	328
query28	4525	2031	2040	2031
query29	1564	732	527	527
query30	300	227	184	184
query31	889	757	646	646
query32	145	101	103	101
query33	529	317	251	251
query34	1166	1131	651	651
query35	713	752	654	654
query36	802	781	695	695
query37	146	108	92	92
query38	1835	1756	1730	1730
query39	690	671	672	671
query39_1	640	641	657	641
query40	222	137	105	105
query41	72	67	68	67
query42	97	92	96	92
query43	329	344	299	299
query44	1412	736	735	735
query45	180	172	160	160
query46	1052	1176	748	748
query47	1484	1489	1388	1388
query48	408	421	302	302
query49	556	396	286	286
query50	942	337	257	257
query51	10593	10568	10126	10126
query52	86	84	74	74
query53	250	258	181	181
query54	261	197	186	186
query55	83	73	67	67
query56	236	212	228	212
query57	1554	1458	1370	1370
query58	272	253	253	253
query59	1971	2063	1865	1865
query60	273	230	220	220
query61	138	163	151	151
query62	393	322	263	263
query63	219	175	174	174
query64	2393	991	827	827
query65	3472	3392	3414	3392
query66	1760	420	300	300
query67	19983	19976	19577	19577
query68	3459	1519	1008	1008
query69	407	296	247	247
query70	864	812	807	807
query71	303	223	236	223
query72	2699	2477	2230	2230
query73	836	795	465	465
query74	4714	4486	4299	4299
query75	2281	2259	1934	1934
query76	2399	1142	743	743
query77	354	386	287	287
query78	9024	8989	8356	8356
query79	1294	1235	732	732
query80	567	472	367	367
query81	524	317	278	278
query82	621	167	124	124
query83	302	220	189	189
query84	316	148	110	110
query85	834	467	379	379
query86	327	244	215	215
query87	1963	1972	1834	1834
query88	3639	2781	2744	2744
query89	362	283	249	249
query90	1954	185	177	177
query91	171	161	131	131
query92	98	86	88	86
query93	1566	1409	909	909
query94	505	342	286	286
query95	675	456	331	331
query96	1133	785	340	340
query97	2436	2441	2310	2310
query98	155	148	162	148
query99	714	714	610	610
Total cold run time: 235373 ms
Total hot run time: 152098 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 24.01 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 270f1d142f62d4bc11523ac23f516901200bf67e, data reload: false

query1	0.01	0.01	0.01
query2	0.09	0.05	0.05
query3	0.26	0.14	0.13
query4	1.60	0.12	0.14
query5	0.24	0.22	0.23
query6	1.15	0.93	0.93
query7	0.03	0.01	0.01
query8	0.06	0.04	0.03
query9	0.39	0.34	0.34
query10	0.53	0.54	0.58
query11	0.20	0.14	0.14
query12	0.18	0.15	0.15
query13	0.46	0.46	0.46
query14	0.96	0.95	0.94
query15	0.60	0.58	0.59
query16	0.30	0.34	0.31
query17	1.11	1.09	1.08
query18	0.23	0.21	0.21
query19	2.04	1.86	1.88
query20	0.02	0.01	0.01
query21	15.49	0.21	0.14
query22	4.90	0.05	0.05
query23	16.12	0.31	0.13
query24	3.01	0.44	0.33
query25	0.12	0.04	0.04
query26	0.73	0.21	0.16
query27	0.05	0.03	0.03
query28	3.51	0.78	0.35
query29	12.48	4.09	3.26
query30	0.28	0.16	0.16
query31	2.77	0.56	0.31
query32	3.23	0.60	0.49
query33	3.30	3.15	3.13
query34	15.58	3.90	3.29
query35	3.22	3.24	3.24
query36	0.54	0.43	0.42
query37	0.09	0.06	0.06
query38	0.06	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	0.14	0.14
query41	0.10	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 96.34 s
Total hot run time: 24.01 s

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.

2 participants