branch-4.1: [fix](test) stabilize PruneOlapScanTabletTest mocks#65768
Draft
shuke987 wants to merge 1 commit into
Draft
branch-4.1: [fix](test) stabilize PruneOlapScanTabletTest mocks#65768shuke987 wants to merge 1 commit into
shuke987 wants to merge 1 commit into
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Collaborator
Author
|
/review |
Collaborator
Author
|
run buildall |
Contributor
There was a problem hiding this comment.
Overall opinion: approve. I found no blocking or actionable issues in this test-only change.
Critical checkpoints:
- Correctness:
@Injectablepreserves the exact four mocked instances used byLogicalOlapScan,PruneOlapScanTablet, andHashDistributionPruner; the unchanged assertion still exercises the 19-tablet pruning result. - Lifecycle and isolation: unlike type-wide
@Mocked, JMockit's instance-scoped injectable mocks leave the live FE's unrelated catalog objects untouched, directly addressing the reported race. - Framework compatibility: the FE module runs JMockit 1.49 as a Surefire javaagent, JMockit supports annotated JUnit 5 method parameters, and the repository has same-lifecycle method-parameter
@Injectableprecedents. - Tests and validation: the author reports three independent runs of this test class; the functional assertions are unchanged;
git diff --checkpasses. Per the review-runner contract, I did not run a build. The aggregate FE UT check was still pending when reviewed. - Compatibility, performance, and documentation: only test annotations/imports change, so there is no production behavior, compatibility, performance, or documentation impact.
- User focus: no additional review focus was supplied.
The main scan plus independent full and risk-focused review lanes found no new valuable findings, and all initial risk points were dismissed with concrete code and framework evidence.
Contributor
FE UT Coverage ReportIncrement line coverage `` 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary:
PruneOlapScanTabletTestextendsSqlTestBase, which starts a live FE, but thetest used method-parameter
@Mockedobjects for four core catalog types. JMockittherefore mocked every instance of those types in the test JVM, including live FE
objects used by background threads. This made expectation recording/replay race
with FE activity and caused intermittent default results or missing invocations
before the tablet-pruning assertion. One example is the null table name failure
in FE UT build 998284.
This change replaces the four type-wide mocks with instance-scoped
@Injectablemocks. The expectations, pruning rule, and 19-tablet assertion are unchanged.
Release note
None
Check List (For Author)
Test
Exact FE UT class passed in three independent runs (6/6 tests total):
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)