-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-4830] Fix testNoGlobalConfFileConfigured when add hudi-defaults.conf in default dir #6652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
xushiyan
merged 4 commits into
apache:master
from
Zouxxyy:zouxxyy/fix-testNoGlobalConfFileConfigured
Sep 26, 2022
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this test broken in CI? I could not reproduce the failure.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DFSPropertiesConfiguration.refreshGlobalProps()only refresh the system props, and the test will fail when/etc/hudi/conf/hudi-defaults.confexists locally.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not create DFSPropertiesConfiguration again to generate the expected value. we should just load the default hudi-defaults.conf with plain java properties and get the count as the expected size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the logic should be count the configs from hudi-defaults.conf at the default path if exists, or make it 0 if not exists. @Zouxxyy can you make change for this please? then we should be good to land
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hudi uses it's own method to read props instead of Apache commons PropertiesConfiguration, just like this
currently there is no static method to get prop directly from a path
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Zouxxyy then we need a different way to load the default conf file and set it as the expected value. the current way is not the right way for testing: both expected and tested use
DFSPropertiesConfigurationto load. what if there is a bug withDFSPropertiesConfigurationloading conf file and both return unexpected numbers, the test would still pass but not catching bugThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some modifications.
I think this test case is only used to test the effect of clearing env HUDI_CONF_DIR, so the test can be ignored when hudi-defaults.conf exists locally.
And if you want to test loading hudi-defaults.conf, it should be covered by other tests, such as testParsing, testLoadGlobalConfFile, etc.