You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by kl...@apache.org on 2020/08/10 11:35:11 UTC

[hive] 01/01: Fixed test

This is an automated email from the ASF dual-hosted git repository.

klcopp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git

commit 597ff16ec9fb0334b4be715e895a0f1bd5775ffa
Author: Karen Coppage <ka...@cloudera.com>
AuthorDate: Mon Aug 10 13:33:36 2020 +0200

    Fixed test
---
 .../apache/hadoop/hive/ql/TestTxnCommandsForMmTable.java | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommandsForMmTable.java b/ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommandsForMmTable.java
index d92b40e..999033f 100644
--- a/ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommandsForMmTable.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommandsForMmTable.java
@@ -514,11 +514,23 @@ public class TestTxnCommandsForMmTable extends TxnCommandsBaseForTests {
     status = fs.listStatus(tblLocation, FileUtils.STAGING_DIR_PATH_FILTER);
     // There should be 2 delta dirs, plus 1 base dir in the location
     Assert.assertEquals(3, status.length);
-    verifyDirAndResult(2, true);
+    int baseCount = 0;
+    int deltaCount = 0;
+    for (int i = 0; i < status.length; i++) {
+      String dirName = status[i].getPath().getName();
+      if (dirName.matches("delta_.*")) {
+        deltaCount++;
+      } else {
+        baseCount++;
+      }
+    }
+    Assert.assertEquals(2, deltaCount);
+    Assert.assertEquals(1, baseCount);
 
     // rename empty file to "_empty"
     Path basePath = new Path(tblLocation, "base_0000003");
-    fs.rename(new Path(basePath, "000000_0"), new Path(basePath, "_empty"));
+    Assert.assertTrue("Rename failed",
+        fs.rename(new Path(basePath, "000000_0"), new Path(basePath, "_empty")));
 
     // 3. Verify query result. Selecting from a truncated table should return nothing.
     List<String> rs = runStatementOnDriver("select a,b from " + TableExtended.MMTBL + " order by a,b");