zabetak commented on a change in pull request #1186:

File path: 
@@ -136,17 +129,19 @@
     ObjectStore objectStore = new ObjectStore();
-    objectStore.dropTable(DEFAULT_CATALOG_NAME, db1Utbl1.getDbName(), 
-    Deadline.startTimer("");
-    objectStore.dropPartitions(DEFAULT_CATALOG_NAME, db1Ptbl1.getDbName(), 
db1Ptbl1.getTableName(), db1Ptbl1PtnNames);
-    objectStore.dropTable(DEFAULT_CATALOG_NAME, db1Ptbl1.getDbName(), 
-    objectStore.dropTable(DEFAULT_CATALOG_NAME, db2Utbl1.getDbName(), 
-    Deadline.startTimer("");
-    objectStore.dropPartitions(DEFAULT_CATALOG_NAME, db2Ptbl1.getDbName(), 
db2Ptbl1.getTableName(), db2Ptbl1PtnNames);
-    objectStore.dropTable(DEFAULT_CATALOG_NAME, db2Ptbl1.getDbName(), 
-    objectStore.dropDatabase(DEFAULT_CATALOG_NAME, db1.getName());
-    objectStore.dropDatabase(DEFAULT_CATALOG_NAME, db2.getName());
+    for (String clg : objectStore.getCatalogs()) {

Review comment:
       The `setUp` method adds things in the Metastore that are not necessarily 
needed by every test and this was the case even before my changes. In the new 
test, I added some more tables/columns cause I think it made things easier to 
understand at least for me. If I was to follow the current pattern I would have 
to add the tables, cols, partitions, etc., in the `setUp` method and then drop 
them in the `teardown` method but then they would be visible to all other tests 
as well. 
   I like the philosophy where unit tests are minimal (least possible state) 
thus I would prefer if every test starts with a clean Metastore and ends with a 
clean Metastore. I didn't change the `setUp` in order not to introduce too many 
unrelated changes but I made one step forward in the `teardown`.  
   If every test in this class was using the same state then I would definitely 
agree that the `setUp` and `teardown` methods should be the way they are right 

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:

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to