Repository: incubator-atlas Updated Branches: refs/heads/master 2c0dc4068 -> 53bbebcba
ATLAS-759 HiveHookIT.testAlterTableChangeColumn is consistently failing on master (yhemanth) Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/53bbebcb Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/53bbebcb Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/53bbebcb Branch: refs/heads/master Commit: 53bbebcba6f26aeffea857d9fd87b7d9eaddad65 Parents: 2c0dc40 Author: Hemanth Yamijala <[email protected]> Authored: Mon May 9 10:23:26 2016 +0530 Committer: Hemanth Yamijala <[email protected]> Committed: Mon May 9 10:23:26 2016 +0530 ---------------------------------------------------------------------- .../org/apache/atlas/hive/hook/HiveHookIT.java | 28 +++++++++++++------- release-log.txt | 1 + 2 files changed, 19 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/53bbebcb/addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java ---------------------------------------------------------------------- diff --git a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java index 317d636..c6206d0 100755 --- a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java +++ b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java @@ -40,6 +40,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.TableType; import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants; +import org.apache.hadoop.hive.ql.CommandNeedRetryException; import org.apache.hadoop.hive.ql.Driver; import org.apache.hadoop.hive.ql.hooks.Entity; import org.apache.hadoop.hive.ql.metadata.Table; @@ -100,10 +101,7 @@ public class HiveHookIT { } private void runCommand(String cmd) throws Exception { - LOG.debug("Running command '{}'", cmd); - ss.setCommandType(null); - CommandProcessorResponse response = driver.run(cmd); - assertEquals(response.getResponseCode(), 0); + runCommandWithDelay(cmd, 0); } @Test @@ -708,7 +706,8 @@ public class HiveHookIT { String newColName = "name1"; String tableName = createTable(); String query = String.format("alter table %s change %s %s string", tableName, oldColName, newColName); - runCommand(query); + runCommandWithDelay(query, 1000); + assertColumnIsNotRegistered(HiveMetaStoreBridge.getColumnQualifiedName( HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, DEFAULT_DB, tableName), oldColName)); assertColumnIsRegistered(HiveMetaStoreBridge.getColumnQualifiedName( @@ -723,7 +722,7 @@ public class HiveHookIT { newColName = "name2"; final String newColType = "int"; query = String.format("alter table %s change column %s %s %s", tableName, oldColName, newColName, newColType); - runCommand(query); + runCommandWithDelay(query, 1000); columns = getColumns(DEFAULT_DB, tableName); Assert.assertEquals(columns.size(), 2); @@ -746,7 +745,7 @@ public class HiveHookIT { final String comment = "added comment"; query = String.format("alter table %s change column %s %s %s COMMENT '%s' after id", tableName, oldColName, newColName, newColType, comment); - runCommand(query); + runCommandWithDelay(query, 1000); columns = getColumns(DEFAULT_DB, tableName); Assert.assertEquals(columns.size(), 2); @@ -755,7 +754,6 @@ public class HiveHookIT { HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, DEFAULT_DB, tableName), oldColName)); newColQualifiedName = HiveMetaStoreBridge.getColumnQualifiedName( HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, DEFAULT_DB, tableName), newColName); - assertColumnIsRegistered(newColQualifiedName, new AssertPredicate() { @Override public void assertOnEntity(Referenceable entity) throws Exception { @@ -768,7 +766,7 @@ public class HiveHookIT { newColName = "name4"; query = String.format("alter table %s change column %s %s %s first", tableName, oldColName, newColName, newColType); - runCommand(query); + runCommandWithDelay(query, 1000); columns = getColumns(DEFAULT_DB, tableName); Assert.assertEquals(columns.size(), 2); @@ -795,7 +793,7 @@ public class HiveHookIT { oldColName = "name4"; newColName = "name5"; query = String.format("alter table %s change column %s %s %s after id", tableName, oldColName, newColName, newColType); - runCommand(query); + runCommandWithDelay(query, 1000); columns = getColumns(DEFAULT_DB, tableName); Assert.assertEquals(columns.size(), 2); @@ -820,6 +818,16 @@ public class HiveHookIT { ); } + private void runCommandWithDelay(String cmd, int sleepMs) throws CommandNeedRetryException, InterruptedException { + LOG.debug("Running command '{}'", cmd); + ss.setCommandType(null); + CommandProcessorResponse response = driver.run(cmd); + assertEquals(response.getResponseCode(), 0); + if (sleepMs != 0) { + Thread.sleep(sleepMs); + } + } + @Test public void testTruncateTable() throws Exception { String tableName = createTable(false); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/53bbebcb/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index 186e93f..783c0de 100644 --- a/release-log.txt +++ b/release-log.txt @@ -18,6 +18,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags) ALL CHANGES: +ATLAS-759 HiveHookIT.testAlterTableChangeColumn is consistently failing on master (yhemanth) ATLAS-690 Read timed out exceptions when tables are imported into Atlas (yhemanth via shwethags) ATLAS-585 NotificationHookConsumer creates new AtlasClient for every message (shwethags) ATLAS-682 Set HBase root dir to be relative to test target directory for HBaseBasedAuditRepositoryTest (shwethags via yhemanth)
