pvary commented on a change in pull request #1495:
URL: https://github.com/apache/iceberg/pull/1495#discussion_r501911231



##########
File path: 
hive-metastore/src/test/java/org/apache/iceberg/hive/HiveCreateReplaceTableTest.java
##########
@@ -104,8 +105,8 @@ public void testCreateTableTxnTableCreatedConcurrently() {
 
     AssertHelpers.assertThrows(
         "Create table txn should fail",
-        AlreadyExistsException.class,
-        "Table already exists: hivedb.tbl",
+        CommitFailedException.class,
+        "is not same as the current table metadata",

Review comment:
       Reverted to the original behavior based on your suggestion.
   Had to refactor stuff to reduce complexity

##########
File path: 
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveMetastore.java
##########
@@ -66,26 +75,31 @@
   private ExecutorService executorService;
   private TServer server;
   private HiveMetaStore.HMSHandler baseHandler;
+  private IMetaStoreClient client = null;
 
   public void start() {
     try {
-      hiveLocalDir = createTempDirectory("hive", 
asFileAttribute(fromString("rwxrwxrwx"))).toFile();
+      this.hiveLocalDir = createTempDirectory("hive", 
asFileAttribute(fromString("rwxrwxrwx"))).toFile();
       File derbyLogFile = new File(hiveLocalDir, "derby.log");
       System.setProperty("derby.stream.error.file", 
derbyLogFile.getAbsolutePath());
       setupMetastoreDB("jdbc:derby:" + getDerbyPath() + ";create=true");
 
       TServerSocket socket = new TServerSocket(0);
       int port = socket.getServerSocket().getLocalPort();
-      hiveConf = newHiveConf(port);
-      server = newThriftServer(socket, hiveConf);
-      executorService = Executors.newSingleThreadExecutor();
-      executorService.submit(() -> server.serve());
+      this.hiveConf = newHiveConf(port);
+      this.server = newThriftServer(socket, hiveConf);
+      this.executorService = Executors.newSingleThreadExecutor();
+      this.executorService.submit(() -> server.serve());
+      this.client = new HiveMetaStoreClient(hiveConf);

Review comment:
       Using a clientPool fixed these issues, but it seems that we do not have 
enough worker in the HMS and this causes failing tests. Need to investigate why 
the  clients are not closed.
   
   Thanks for taking a look! 




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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to