You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sa...@apache.org on 2019/03/21 21:48:29 UTC
[atlas] branch branch-1.0 updated: ATLAS-3067: Fix intermittent IT
failure in HiveHookIT.testAlterTableLocation()
This is an automated email from the ASF dual-hosted git repository.
sarath pushed a commit to branch branch-1.0
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/branch-1.0 by this push:
new d17713f ATLAS-3067: Fix intermittent IT failure in HiveHookIT.testAlterTableLocation()
d17713f is described below
commit d17713fbf1fc0258dc6f2b9d59981e4999efec59
Author: Sarath Subramanian <ss...@hortonworks.com>
AuthorDate: Thu Mar 21 14:47:22 2019 -0700
ATLAS-3067: Fix intermittent IT failure in HiveHookIT.testAlterTableLocation()
(cherry picked from commit 67a681f2b36637ce691f2bec9d4296b674c6c92e)
---
.../src/test/java/org/apache/atlas/hive/HiveITBase.java | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
index 6acf89d..fad24e7 100644
--- a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
+++ b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
@@ -52,7 +52,6 @@ import org.apache.hadoop.security.UserGroupInformation;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import java.io.File;
@@ -60,7 +59,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
-import java.util.Date;
+import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
@@ -71,6 +70,7 @@ import java.util.SortedSet;
import static org.apache.atlas.hive.bridge.HiveMetaStoreBridge.HDFS_PATH;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
public class HiveITBase {
@@ -288,10 +288,20 @@ public class HiveITBase {
String testPathNormed = lower(path.toString());
String hdfsPathId = assertHDFSPathIsRegistered(testPathNormed);
- Assert.assertEquals(hdfsPathIds.get(0).getGuid(), hdfsPathId);
+ assertHDFSPathIdsContain(hdfsPathIds, hdfsPathId);
}
}
+ private void assertHDFSPathIdsContain(List<AtlasObjectId> hdfsPathObjectIds, String hdfsPathId) {
+ Set<String> hdfsPathGuids = new HashSet<>();
+
+ for (AtlasObjectId hdfsPathObjectId : hdfsPathObjectIds) {
+ hdfsPathGuids.add(hdfsPathObjectId.getGuid());
+ }
+
+ assertTrue(hdfsPathGuids.contains(hdfsPathId));
+ }
+
protected String assertHDFSPathIsRegistered(String path) throws Exception {
LOG.debug("Searching for hdfs path {}", path);
// ATLAS-2444 HDFS name node federation adds the cluster name to the qualifiedName