haizhou-zhao commented on code in PR #11093:
URL: https://github.com/apache/iceberg/pull/11093#discussion_r1825101193


##########
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/TestBaseWithCatalog.java:
##########
@@ -59,18 +86,30 @@ protected static Object[][] parameters() {
   }
 
   @BeforeAll
-  public static void createWarehouse() throws IOException {
+  public static void setUpAll() throws IOException {
     TestBaseWithCatalog.warehouse = File.createTempFile("warehouse", null);
     assertThat(warehouse.delete()).isTrue();
+    initRESTCatalog();
   }
 
   @AfterAll
-  public static void dropWarehouse() throws IOException {
+  public static void tearDownAll() throws Exception {
     if (warehouse != null && warehouse.exists()) {
       Path warehousePath = new Path(warehouse.getAbsolutePath());
       FileSystem fs = warehousePath.getFileSystem(hiveConf);
       assertThat(fs.delete(warehousePath, true)).as("Failed to delete " + 
warehousePath).isTrue();
     }
+    stopRESTCatalog();
+  }
+
+  private static void initRESTCatalog() {
+    restCatalog = RCKUtils.initCatalogClient(REST_SERVER_EXTENSION.config());

Review Comment:
   I made `RCKUtils` package protected again in the latest commit. A little bit 
different from what you suggested above is: the Spark integ test rely on REST 
client being initialized in static context, so initializing restCatalog in 
`beforeEach` might be hard. Solved the problem by making `RESTServerExtention` 
taking control over client life cycle along side server life cycle. Anyway, in 
the end, `RCKUtils` is package protected again.



##########
open-api/src/testFixtures/java/org/apache/iceberg/rest/RCKUtils.java:
##########
@@ -76,15 +78,22 @@ static Map<String, String> environmentCatalogConfig() {
                 HashMap::new));
   }
 
-  static RESTCatalog initCatalogClient() {
+  public static RESTCatalog initCatalogClient() {

Review Comment:
   Done



-- 
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: issues-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to