jerryshao commented on code in PR #14981:
URL: https://github.com/apache/gravitino/pull/14981#discussion_r4583238568


##########
integration-test-common/src/test/java/org/apache/gravitino/integration/test/MiniGravitino.java:
##########
@@ -277,6 +278,38 @@ Map<String, String> getIcebergRestServiceConfigs() throws 
IOException {
     return customConfigs;
   }
 
+  // Customize the config file
+  @VisibleForTesting
+  void customizeConfigFile(String configTempFileName, String configFileName) 
throws IOException {
+    Map<String, String> configMap = new HashMap<>();
+    configMap.put(
+        GravitinoServer.WEBSERVER_CONF_PREFIX + 
JettyServerConfig.WEBSERVER_HTTP_PORT.getKey(),
+        String.valueOf(RESTUtils.findAvailablePort(2000, 3000)));
+
+    configMap.putAll(getIcebergRestServiceConfigs());
+    configMap.putAll(getLanceRestServiceConfigs(configMap));
+    configMap.putAll(context.customConfig);
+
+    Properties configProperties = serverConfig.loadPropertiesFromFile(new 
File(configTempFileName));
+    configProperties.putAll(configMap);
+    String jdbcUrl =
+        configProperties.getProperty(
+            Configs.ENTITY_RELATIONAL_JDBC_BACKEND_URL_KEY,
+            Configs.DEFAULT_RELATIONAL_JDBC_BACKEND_URL);

Review Comment:
   [P2] When the template and override map omit the JDBC URL, a suite can still 
select its database with `-Dgravitino.entity.store.relational.jdbcUrl`. This 
fallback writes the default H2 URL into the generated file, which takes 
precedence over that JVM setting at startup. Please resolve the effective URL 
and storage path with the same `ServerConfig` defaults and file precedence as 
`GravitinoServer.loadConfig` before applying `WRITE_DELAY=0`. A regression test 
can set a custom H2 file URL as a JVM property, omit the template URL, and 
verify that the effective URL still points to the custom database.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to