Repository: hive Updated Branches: refs/heads/master 253ce3917 -> b6e39c9e8
HIVE-16192 : QTestUtil doesn't correctly set the last command when running "test" commands (Sahil Takiar via Ashutosh Chauhan) Signed-off-by: Ashutosh Chauhan <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/b6e39c9e Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/b6e39c9e Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/b6e39c9e Branch: refs/heads/master Commit: b6e39c9e87ba275f5d243f83a2231eeb8f991890 Parents: 253ce39 Author: Sahil Takiar <[email protected]> Authored: Tue Mar 14 08:15:39 2017 -0700 Committer: Ashutosh Chauhan <[email protected]> Committed: Tue Mar 14 08:15:39 2017 -0700 ---------------------------------------------------------------------- .../src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/b6e39c9e/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java ---------------------------------------------------------------------- diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java index 7a36b46..f469def 100644 --- a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java +++ b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java @@ -1384,6 +1384,10 @@ public class QTestUtil { commandArgs = commandArgs.replaceAll("\\$\\{hiveconf:hive\\.metastore\\.warehouse\\.dir\\}", wareHouseDir); + if (SessionState.get() != null) { + SessionState.get().setLastCommand(commandName + " " + commandArgs.trim()); + } + enableTestOnlyCmd(SessionState.get().getConf()); try { @@ -2196,7 +2200,7 @@ public class QTestUtil { public void failed(int ecode, String fname, String debugHint) { String command = SessionState.get() != null ? SessionState.get().getLastCommand() : null; String message = "Client execution failed with error code = " + ecode + - (command != null ? " running " + command : "") + "fname=" + fname + + (command != null ? " running \"" + command : "") + "\" fname=" + fname + " " + (debugHint != null ? debugHint : ""); LOG.error(message); Assert.fail(message);
