HIVE-25249: Fix TestWorker (Denys Kuzmenko, reviewed by Karen Coppage)
Closes (#2474)
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/CompactorTest.java b/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/CompactorTest.java
index 4ca53da..66335c9 100644
--- a/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/CompactorTest.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/CompactorTest.java
@@ -118,6 +118,7 @@
@Before
public void setup() throws Exception {
conf = new HiveConf();
+ MetastoreConf.setTimeVar(conf, MetastoreConf.ConfVars.TXN_OPENTXN_TIMEOUT, 2, TimeUnit.SECONDS);
TestTxnDbUtil.setConfValues(conf);
TestTxnDbUtil.cleanDb(conf);
TestTxnDbUtil.prepDb(conf);
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestWorker.java b/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestWorker.java
index 6428ad7..8d19839 100644
--- a/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestWorker.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestWorker.java
@@ -66,6 +66,7 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
+import static org.apache.hadoop.hive.common.AcidConstants.VISIBILITY_PATTERN;
import static org.mockito.Mockito.doReturn;
/**
@@ -75,7 +76,6 @@
* Delta files created by SQL should have [N,N] range (and a suffix in v1.3 and later)
* Need to change some of these to have better test coverage.
*/
-@org.junit.Ignore("HIVE-25249")
public class TestWorker extends CompactorTest {
private static final String CLASS_NAME = TestWorker.class.getName();
@@ -629,8 +629,8 @@
// Find the new delta file and make sure it has the right contents
List<String> matchesNotFound = new ArrayList<>(numFilesExpected);
- matchesNotFound.add(makeDeleteDeltaDirNameCompacted(21,23) + "_v\\d+");
- matchesNotFound.add(makeDeleteDeltaDirNameCompacted(25,33) + "_v\\d+");
+ matchesNotFound.add(makeDeleteDeltaDirNameCompacted(21,23) + VISIBILITY_PATTERN);
+ matchesNotFound.add(makeDeleteDeltaDirNameCompacted(25,33) + VISIBILITY_PATTERN);
matchesNotFound.add(makeDeltaDirName(21,21));
matchesNotFound.add(makeDeltaDirName(23, 23));
matchesNotFound.add(makeDeltaDirNameCompacted(25, 29));//streaming ingest
@@ -638,14 +638,14 @@
//todo: this should have some _vXXXX suffix but addDeltaFile() doesn't support it
matchesNotFound.add(makeDeltaDirNameCompacted(31, 33));
matchesNotFound.add(makeDeltaDirName(35, 35));
- matchesNotFound.add(makeDeltaDirNameCompacted(21,23) + "_v\\d+");
- matchesNotFound.add(makeDeltaDirNameCompacted(25,33) + "_v\\d+");
+ matchesNotFound.add(makeDeltaDirNameCompacted(21,23) + VISIBILITY_PATTERN);
+ matchesNotFound.add(makeDeltaDirNameCompacted(25,33) + VISIBILITY_PATTERN);
if(type == CompactionType.MINOR) {
- matchesNotFound.add(makeDeltaDirNameCompacted(21,35) + "_v\\d+");
- matchesNotFound.add(makeDeleteDeltaDirNameCompacted(21, 35) + "_v\\d+");
+ matchesNotFound.add(makeDeltaDirNameCompacted(21,35) + VISIBILITY_PATTERN);
+ matchesNotFound.add(makeDeleteDeltaDirNameCompacted(21, 35) + VISIBILITY_PATTERN);
}
if(type == CompactionType.MAJOR) {
- matchesNotFound.add(AcidUtils.baseDir(35) + "_v\\d+");
+ matchesNotFound.add(AcidUtils.baseDir(35) + VISIBILITY_PATTERN);
}
for(FileStatus f : stat) {
for(int j = 0; j < matchesNotFound.size(); j++) {