[fix](fe) Stabilize optimize available MV unit test#64636
Open
seawinde wants to merge 1 commit into
Open
Conversation
### What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary:
OptimizeGetAvailableMvsTest could fail intermittently because TestWithFeService reuses the same FE environment across test methods. If a materialized view survived a failed assertion, a later case could see an extra rewrite candidate. The partition-prune case also depended on the asynchronous MTMV refresh state before the materialized view became a rewrite candidate, so the candidate map could be empty.
Root cause: In OptimizeGetAvailableMvsTest, test methods created materialized views with fixed names and only dropped them at the end of the happy path, so failed assertions could leave state behind for later test methods. The partition-prune case also did not mock MTMV.canBeCandidate(), which made the test depend on asynchronous MTMV refresh state.
Change Summary:
- OptimizeGetAvailableMvsTest: drop test materialized views before and after each test.
- OptimizeGetAvailableMvsTest: mock MTMV.canBeCandidate() in the partition-prune case.
### Release note
None
### Check List (For Author)
- Test: Unit Test
- git diff --check upstream/branch-4.1...HEAD
- mvn -pl fe-core -am test -Dcheckstyle.skip=true -DfailIfNoTests=false -Dtest=org.apache.doris.nereids.mv.OptimizeGetAvailableMvsTest -Dskip.clean=true
- Behavior changed: No
- Does this need documentation: No
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
run buildall |
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:
OptimizeGetAvailableMvsTestcould fail intermittently becauseTestWithFeServicereuses the same FE environment across test methods. If a materialized view survived a failed assertion, a later case could see an extra rewrite candidate. The partition-prune case also depended on asynchronous MTMV refresh state before the materialized view became a rewrite candidate, so the candidate map could be empty.Root cause: In
OptimizeGetAvailableMvsTest, test methods created materialized views with fixed names and only dropped them at the end of the happy path, so failed assertions could leave state behind for later test methods. The partition-prune case also did not mockMTMV.canBeCandidate(), which made the test depend on asynchronous MTMV refresh state.Change Summary:
OptimizeGetAvailableMvsTest.javaOptimizeGetAvailableMvsTest.javaMTMV.canBeCandidate()in the partition-prune case.Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)