Skip to content

[fix](test) replace removed JMockit with Mockito in CloudProcVersionDisplayTest#63473

Merged
hello-stephen merged 1 commit into
apache:masterfrom
yx-keith:fix-cloudproc-jmockit
May 21, 2026
Merged

[fix](test) replace removed JMockit with Mockito in CloudProcVersionDisplayTest#63473
hello-stephen merged 1 commit into
apache:masterfrom
yx-keith:fix-cloudproc-jmockit

Conversation

@yx-keith
Copy link
Copy Markdown
Contributor

@yx-keith yx-keith commented May 21, 2026

CloudProcVersionDisplayTest still imported mockit.Expectations / mockit.Mocked, but JMockit was removed from fe-core, so it was the only file under fe/ importing mockit and broke compilation with "package mockit does not exist", failing FE UT on master.

Rewrite the mocking with Mockito (mockito-inline is already a dependency): @mocked fields become Mockito.mock(...), and the static Env methods are stubbed via Mockito.mockStatic(Env.class, CALLS_REAL_METHODS), following the existing BDBJEJournalTest pattern. Test logic and assertions are unchanged.

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

…isplayTest

CloudProcVersionDisplayTest still imported mockit.Expectations / mockit.Mocked,
but JMockit was removed from fe-core, so it was the only file under fe/ importing
mockit and broke compilation with "package mockit does not exist", failing FE UT
on master.

Rewrite the mocking with Mockito (mockito-inline is already a dependency):
@mocked fields become Mockito.mock(...), and the static Env methods are stubbed
via Mockito.mockStatic(Env.class, CALLS_REAL_METHODS), following the existing
BDBJEJournalTest pattern. Test logic and assertions are unchanged.
@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?

@yx-keith
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-H: Total hot run time: 31080 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 3f64f5d73803cc7f5ddc7d650ffa8adaa0afd4b7, data reload: false

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17616	3846	3800	3800
q2	q3	10751	1364	803	803
q4	4683	471	341	341
q5	7674	2260	2110	2110
q6	237	176	135	135
q7	941	769	641	641
q8	9362	1626	1512	1512
q9	5534	4899	4899	4899
q10	6389	2068	1762	1762
q11	440	262	241	241
q12	691	419	286	286
q13	18196	3366	2823	2823
q14	263	252	234	234
q15	q16	822	773	705	705
q17	954	872	978	872
q18	7241	5780	5515	5515
q19	1304	1349	1129	1129
q20	498	472	360	360
q21	6083	2838	2594	2594
q22	464	505	318	318
Total cold run time: 100143 ms
Total hot run time: 31080 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4633	4476	4525	4476
q2	q3	4738	5184	4565	4565
q4	2129	2227	1406	1406
q5	4773	4606	4568	4568
q6	225	178	128	128
q7	1969	1742	1539	1539
q8	2327	2092	2072	2072
q9	7692	7452	7159	7159
q10	4444	4385	3942	3942
q11	523	364	346	346
q12	699	715	510	510
q13	2989	3341	2799	2799
q14	260	266	273	266
q15	q16	675	704	608	608
q17	1243	1234	1217	1217
q18	7175	6696	6752	6696
q19	1104	1074	1101	1074
q20	2210	2205	1937	1937
q21	5296	4596	4516	4516
q22	535	457	418	418
Total cold run time: 55639 ms
Total hot run time: 50242 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 168976 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 3f64f5d73803cc7f5ddc7d650ffa8adaa0afd4b7, data reload: false

query5	4320	648	510	510
query6	332	216	208	208
query7	4223	541	292	292
query8	327	241	224	224
query9	8852	3951	3973	3951
query10	463	350	301	301
query11	5808	2376	2192	2192
query12	180	130	126	126
query13	1327	611	423	423
query14	6000	5351	5029	5029
query14_1	4322	4316	4281	4281
query15	217	202	183	183
query16	1007	455	370	370
query17	1115	722	577	577
query18	2715	473	347	347
query19	210	203	160	160
query20	137	129	128	128
query21	216	137	114	114
query22	13597	13515	13393	13393
query23	17272	16433	16035	16035
query23_1	16181	16149	16198	16149
query24	7434	1771	1322	1322
query24_1	1307	1283	1304	1283
query25	572	493	449	449
query26	1312	320	177	177
query27	2681	549	345	345
query28	4484	1963	1971	1963
query29	1016	627	516	516
query30	314	243	203	203
query31	1114	1082	956	956
query32	91	81	77	77
query33	577	366	299	299
query34	1168	1113	649	649
query35	756	797	678	678
query36	1324	1317	1183	1183
query37	156	106	97	97
query38	3220	3113	3059	3059
query39	938	911	888	888
query39_1	869	878	894	878
query40	236	158	131	131
query41	78	72	69	69
query42	112	112	112	112
query43	322	331	298	298
query44	
query45	216	204	199	199
query46	1069	1167	726	726
query47	2388	2340	2247	2247
query48	407	401	298	298
query49	672	510	396	396
query50	1006	367	253	253
query51	4300	4233	4226	4226
query52	106	111	98	98
query53	252	283	210	210
query54	328	298	280	280
query55	97	102	87	87
query56	311	317	345	317
query57	1419	1387	1313	1313
query58	315	265	278	265
query59	1557	1641	1434	1434
query60	339	354	293	293
query61	159	155	151	151
query62	668	641	557	557
query63	256	198	199	198
query64	2373	799	631	631
query65	
query66	1666	475	351	351
query67	30093	29921	29822	29822
query68	
query69	461	344	295	295
query70	1068	1015	992	992
query71	302	273	259	259
query72	3006	2752	2414	2414
query73	853	764	432	432
query74	5034	4882	4727	4727
query75	2653	2574	2266	2266
query76	2313	1137	777	777
query77	396	398	334	334
query78	12093	12138	11549	11549
query79	1457	1038	725	725
query80	850	526	442	442
query81	486	277	236	236
query82	1410	156	123	123
query83	343	266	244	244
query84	261	138	109	109
query85	909	534	453	453
query86	434	347	351	347
query87	3423	3390	3199	3199
query88	3518	2670	2610	2610
query89	441	380	334	334
query90	1793	186	178	178
query91	182	169	143	143
query92	77	74	77	74
query93	1468	1422	866	866
query94	616	354	307	307
query95	699	374	345	345
query96	998	757	342	342
query97	2711	2709	2553	2553
query98	240	230	227	227
query99	1128	1097	977	977
Total cold run time: 253453 ms
Total hot run time: 168976 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage `` 🎉
Increment coverage report
Complete coverage report

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label May 21, 2026
@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.

@hello-stephen
Copy link
Copy Markdown
Contributor

skip buildall

@hello-stephen hello-stephen merged commit 3da4d2b into apache:master May 21, 2026
33 checks passed
@morrySnow morrySnow changed the title [fix](test) replace removed JMockit with Mockito in CloudProcVersionD… [fix](test) replace removed JMockit with Mockito in CloudProcVersionDisplayTest May 21, 2026
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. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants