Repository: hive Updated Branches: refs/heads/master 3d834677a -> 6875c7655
HIVE-19575: TestAutoPurgeTables seems flaky (Prasanth Jayachandran, reviewed by Jesus Camacho Rodriguez) (addendum) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/6875c765 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/6875c765 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/6875c765 Branch: refs/heads/master Commit: 6875c7655fc4925332ec0e71db1a3b37430a40a7 Parents: 3d83467 Author: Jesus Camacho Rodriguez <[email protected]> Authored: Wed May 16 14:05:42 2018 -0700 Committer: Jesus Camacho Rodriguez <[email protected]> Committed: Wed May 16 14:05:42 2018 -0700 ---------------------------------------------------------------------- .../java/org/apache/hadoop/hive/ql/TestAutoPurgeTables.java | 8 ++++++++ 1 file changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/6875c765/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/TestAutoPurgeTables.java ---------------------------------------------------------------------- diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/TestAutoPurgeTables.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/TestAutoPurgeTables.java index c45c959..34d6d39 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/TestAutoPurgeTables.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/TestAutoPurgeTables.java @@ -33,6 +33,7 @@ import org.apache.hadoop.hive.ql.stats.StatsUtils; import org.apache.hadoop.hive.shims.ShimLoader; import org.apache.hive.common.util.RetryTestRunner; import org.apache.hive.jdbc.miniHS2.MiniHS2; +import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; @@ -164,6 +165,13 @@ public class TestAutoPurgeTables { } @Before + public void beforeTest() throws Exception { + FileSystem fs = FileSystem.get(conf); + Path trashDir = ShimLoader.getHadoopShims().getCurrentTrashPath(conf, fs); + fs.delete(trashDir, true); + } + + @After public void afterTest() throws Exception { FileSystem fs = FileSystem.get(conf); Path trashDir = ShimLoader.getHadoopShims().getCurrentTrashPath(conf, fs);
