[ 
https://issues.apache.org/jira/browse/HIVE-25618?focusedWorklogId=666876&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-666876
 ]

ASF GitHub Bot logged work on HIVE-25618:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 19/Oct/21 11:14
            Start Date: 19/Oct/21 11:14
    Worklog Time Spent: 10m 
      Work Description: kgyrtkirk commented on a change in pull request #2726:
URL: https://github.com/apache/hive/pull/2726#discussion_r731753660



##########
File path: 
itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CliAdapter.java
##########
@@ -59,10 +59,10 @@ public CliAdapter(AbstractCliConfig cliConfig) {
   public abstract void beforeClass() throws Exception;
 
   // HIVE-14444 pending rename: before

Review comment:
       you may also rename these methods....

##########
File path: 
itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CoreCliDriver.java
##########
@@ -67,91 +67,60 @@ public void beforeClass() {
     String cleanupScript = cliConfig.getCleanupScript();
     Set<QTestExternalDB> externalDBs = cliConfig.getExternalDBs();
 
-    try {
-      qt = new ElapsedTimeLoggingWrapper<QTestUtil>() {
-        @Override
-        public QTestUtil invokeInternal() throws Exception {
-          return new QTestUtil(
-              QTestArguments.QTestArgumentsBuilder.instance()
-                .withOutDir(cliConfig.getResultsDir())
-                .withLogDir(cliConfig.getLogDir())
-                .withClusterType(miniMR)
-                .withConfDir(hiveConfDir)
-                .withInitScript(initScript)
-                .withCleanupScript(cleanupScript)
-                .withExternalDBs(externalDBs)
-                .withLlapIo(true)
-                .withFsType(cliConfig.getFsType())
-                .build());
-        }
-      }.invoke("QtestUtil instance created", LOG, true);
-    } catch (Exception e) {
-      System.err.println("Exception: " + e.getMessage());
-      e.printStackTrace();
-      System.err.flush();
-      throw new RuntimeException("Unexpected exception in static 
initialization", e);
-    }
+    qt = new ElapsedTimeLoggingWrapper<QTestUtil>() {
+      @Override
+      public QTestUtil invokeInternal() throws Exception {
+        return new QTestUtil(
+            QTestArguments.QTestArgumentsBuilder.instance()
+              .withOutDir(cliConfig.getResultsDir())
+              .withLogDir(cliConfig.getLogDir())
+              .withClusterType(miniMR)
+              .withConfDir(hiveConfDir)
+              .withInitScript(initScript)
+              .withCleanupScript(cleanupScript)
+              .withExternalDBs(externalDBs)
+              .withLlapIo(true)
+              .withFsType(cliConfig.getFsType())
+              .build());
+      }
+    }.invoke("QtestUtil instance created", LOG, true);
   }
 
   @Override
   @Before
-  public void setUp() {
-    try {
-      new ElapsedTimeLoggingWrapper<Void>() {
-        @Override
-        public Void invokeInternal() throws Exception {
-          qt.newSession();
-          return null;
-        }
-      }.invoke("PerTestSetup done.", LOG, false);
-
-    } catch (Exception e) {
-      System.err.println("Exception: " + e.getMessage());
-      e.printStackTrace();
-      System.err.flush();
-      fail("Unexpected exception in setup");
-    }
+  public void setUp() throws Exception {
+    new ElapsedTimeLoggingWrapper<Void>() {
+      @Override
+      public Void invokeInternal() throws Exception {
+        qt.newSession();
+        return null;
+      }
+    }.invoke("PerTestSetup done.", LOG, false);
   }
 
   @Override
   @After
-  public void tearDown() {
-    try {
-      new ElapsedTimeLoggingWrapper<Void>() {
-        @Override
-        public Void invokeInternal() throws Exception {
-          qt.clearPostTestEffects();
-          qt.clearTestSideEffects();
-          return null;
-        }
-      }.invoke("PerTestTearDown done.", LOG, false);
-
-    } catch (Exception e) {
-      System.err.println("Exception: " + e.getMessage());
-      e.printStackTrace();
-      System.err.flush();
-      fail("Unexpected exception in tearDown");
-    }
+  public void tearDown() throws Exception {
+    new ElapsedTimeLoggingWrapper<Void>() {

Review comment:
       I think these LogginWrapper things doesnt add much value - if we want 
something like this we could implement it in a different manner...




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 666876)
    Time Spent: 20m  (was: 10m)

> Stack trace is difficult to find when qtest fails during setup/teardown
> -----------------------------------------------------------------------
>
>                 Key: HIVE-25618
>                 URL: https://issues.apache.org/jira/browse/HIVE-25618
>             Project: Hive
>          Issue Type: Improvement
>          Components: Testing Infrastructure
>            Reporter: Stamatis Zampetakis
>            Assignee: Stamatis Zampetakis
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> When a qtest fails while executing one of the setup/teardown methods of a CLI 
> driver 
> ([CliAdapter|https://github.com/apache/hive/blob/3e37ba473545a691f5f32c08fc4b62b49257cab4/itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CliAdapter.java#L36]
>  and its subclasses):
> {code:java}
>   public abstract void beforeClass() throws Exception;
>   public abstract void setUp();
>   public abstract void tearDown();
>   public abstract void shutdown() throws Exception;
> {code}
> the original stack trace leading to the failure cannot be found easily. 
> Maven console shows a stack trace which doesn't correspond to the actual 
> exception causing the problem but another one which in most cases does not 
> contain the original cause. 
> The original stack trace is not displayed in the maven console and it is not 
> in the {{target/tmp/logs/hive.log}} either. At the moment it goes to 
> {{target/surefire-reports/...-output.txt}}. 
> The developer needs to search in 2-3 places and navigate back and forth to 
> the code in order to find what went wrong.
> Ideally the stack trace from the original exception should be printed 
> directly in maven console. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to