Uh oh!
There was an error while loading. Please reload this page.
[fix](test) stabilize CreateResourceCommandTest - #65767
Conversation
hello-stephen
commented
Jul 17, 2026
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
shuke987
commented
Jul 17, 2026
run buildall |
shuke987
commented
Jul 17, 2026
/review |
There was a problem hiding this comment.
Automated review summary
Overall: No blocking issue found. This test-only change removes the process-wide JMockit mocks, keeps the real FE Env, and limits the test double to the single ADMIN decision exercised by testValidate; production resource behavior is unchanged.
Critical checkpoints:
- Correctness and test intent: the Mockito matchers bind to the exact
checkGlobalPriv(ConnectContext, ADMIN)call used byCreateResourceInfo.validate(), so the normal and invalid-property/type assertions still reach their intended validation paths. - Lifecycle and concurrency: the injected spy remains for the rest of this test class, but FE UT classes run in non-reused Surefire forks, the only later method uses the root context whose real manager also grants ADMIN, and the spy delegates all other calls. No observable same-class, cross-class, or daemon-race defect was substantiated.
- Compatibility, security, and performance: only test code changes; no production API, persistence, authorization, runtime, or resource-type behavior changes.
- Test coverage and validation: the full one-file diff and both test paths were reviewed statically. Per the PR description, the exact FE test class and full Maven reactor passed twice; this review runner did not rerun builds or tests.
- Documentation and release notes: no documentation or release note is needed for this test stabilization.
User focus: No additional user-provided focus was supplied; the full PR was reviewed.
Conclusion: comment-only approval opinion with no inline issues.
hello-stephen
commented
Jul 17, 2026
FE UT Coverage ReportIncrement line coverage `` 🎉 |
What problem does this PR solve?
Issue Number: DORIS-26901
Related PR: #65072, #62221
Problem Summary:
CreateResourceCommandTeststarts a real FE, buttestValidateglobally mocksEnvwith JMockit. FE background daemons concurrently callEnv.getServingEnv().isReady()while the test records expectations. JMockit's process-wide record state is then contaminated, causing intermittentMissingInvocation, incompatible return type, andConcurrentModificationExceptionfailures before the resource validation assertions run.The failure appeared in 11 of 80 branch-4.1 FE UT occurrences across 7 unrelated PRs. #65072 retained/widened the global JMockit setup on branch-4.1, while #62221 already uses the narrow Mockito pattern on master.
This PR keeps the real FE
Env, spies onlyAccessControllerManager, stubs the singleADMINprivilege decision needed by the test, and injects the spy into the real environment. It removes the global JMockit mocks forEnv,AccessControllerManager, andSystemInfoService.No production code or resource validation assertion is changed.
Validation:
./run-fe-ut.sh --run org.apache.doris.nereids.trees.plans.commands.CreateResourceCommandTestmvn test -Dcheckstyle.skip=true -DfailIfNoTests=false -Dtest=org.apache.doris.nereids.trees.plans.commands.CreateResourceCommandTestgit diff --checkpassed.Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)