You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/12/22 20:52:39 UTC

[GitHub] [hive] kishendas commented on a change in pull request #1808: HIVE-24561: Deflake TestCachedStoreUpdateUsingEvents test

kishendas commented on a change in pull request #1808:
URL: https://github.com/apache/hive/pull/1808#discussion_r547501638



##########
File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/cache/TestCachedStoreUpdateUsingEvents.java
##########
@@ -82,9 +84,9 @@ public void setUp() throws Exception {
     HiveMetaStore.HMSHandler.createDefaultCatalog(rawStore, new Warehouse(conf));
   }
 
-  private Database createTestDb(String dbName, String dbOwner) {
+  private Database createTestDb(String dbName, String dbOwner) throws IOException {
     String dbDescription = dbName;
-    String dbLocation = "file:/tmp";
+    String dbLocation = Files.createTempDirectory(dbName).toString();

Review comment:
       Even the dbName can be same across multiple tests, which can get cleaned up. Would it be a good idea to use the current timestamp or generate a random number and use that for the temporary directory ?

##########
File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/cache/TestCachedStoreUpdateUsingEvents.java
##########
@@ -94,8 +96,9 @@ private Database createTestDb(String dbName, String dbOwner) {
   }
 
   private Table createTestTblParam(String dbName, String tblName, String tblOwner,
-                              List<FieldSchema> cols, List<FieldSchema> ptnCols, Map<String, String> tblParams) {
-    String serdeLocation = "file:/tmp";
+                              List<FieldSchema> cols, List<FieldSchema> ptnCols, Map<String, String> tblParams)
+      throws IOException {
+    String serdeLocation = Files.createTempDirectory(dbName + "_" + tblName).toString();

Review comment:
       Even the dbName and tblName can be same across multiple tests, which can get cleaned up. Would it be a good idea to use the current timestamp or generate a random number and use that for the temporary directory ?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org