Zouxxyy commented on code in PR #6652:
URL: https://github.com/apache/hudi/pull/6652#discussion_r978306628


##########
hudi-common/src/test/java/org/apache/hudi/common/util/TestDFSPropertiesConfiguration.java:
##########
@@ -173,7 +173,9 @@ public void testNoGlobalConfFileConfigured() {
     
ENVIRONMENT_VARIABLES.clear(DFSPropertiesConfiguration.CONF_FILE_DIR_ENV_NAME);
     // Should not throw any exception when no external configuration file 
configured
     DFSPropertiesConfiguration.refreshGlobalProps();
-    assertEquals(0, DFSPropertiesConfiguration.getGlobalProps().size());
+    DFSPropertiesConfiguration defaultDfsPropertiesConfiguration = new 
DFSPropertiesConfiguration();
+    
defaultDfsPropertiesConfiguration.addPropsFromFile(DFSPropertiesConfiguration.DEFAULT_PATH);
+    assertEquals(defaultDfsPropertiesConfiguration.getProps().size(), 
DFSPropertiesConfiguration.getGlobalProps().size());

Review Comment:
   > @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 `DFSPropertiesConfiguration` to load. what if 
there is a bug with `DFSPropertiesConfiguration` loading conf file and both 
return unexpected numbers, the test would still pass but not catching bug
   
   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.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to