hqbhoho commented on code in PR #8419:
URL: https://github.com/apache/gravitino/pull/8419#discussion_r2329096147


##########
trino-connector/integration-test/src/test/java/org/apache/gravitino/trino/connector/integration/test/TrinoQueryITBase.java:
##########
@@ -103,7 +113,10 @@ public void setup() throws Exception {
 
     setEnv();
     trinoQueryRunner = new TrinoQueryRunner(trinoUri);
-    createMetalake();
+
+    if (!autoStart) {
+      createMetalake();
+    }

Review Comment:
   > I think invoking createMetalake is mandatory and is not related to whether 
it starts automatically.
   
   I don't change the original logic. If autoStart, I add `createMetalake()` in 
`setEnv`.
   Maybe we can add all`createMetalake()` in `setEnv` in this PR
   ```
   private void setEnv() throws Exception {
       baseIT = new BaseIT();
       if (autoStart) {
         baseIT.startIntegrationTest();
         gravitinoClient = baseIT.getGravitinoClient();
         gravitinoUri = String.format("http://127.0.0.1:%d";, 
baseIT.getGravitinoServerPort());
         // The creation of a metalake must be completed before the Trino 
cluster is deployed.
         createMetalake();
   
         trinoITContainers = ContainerSuite.getTrinoITContainers();
         trinoITContainers.launch(baseIT.getGravitinoServerPort(), 
trinoWorkerNum);
   
         trinoUri = trinoITContainers.getTrinoUri();
         hiveMetastoreUri = trinoITContainers.getHiveMetastoreUri();
         hdfsUri = trinoITContainers.getHdfsUri();
         mysqlUri = trinoITContainers.getMysqlUri();
         postgresqlUri = trinoITContainers.getPostgresqlUri();
   
       } else if (autoStartGravitino) {
         baseIT.startIntegrationTest();
         gravitinoClient = baseIT.getGravitinoClient();
         gravitinoUri = String.format("http://127.0.0.1:%d";, 
baseIT.getGravitinoServerPort());
         createMetalake();
       } else {
         gravitinoClient = GravitinoAdminClient.builder(gravitinoUri).build();
         createMetalake();
       }
     }
   ```
   Furthermore, `create metalake` maybe  a part of the Gravitino server-side 
startup for test. I think it should create a new PR for this.
   
   Curently, I run the integration test  failed sometimes in local, Trino 
master will exit because of metalake not exists. 
   



-- 
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