You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lens.apache.org by su...@apache.org on 2016/10/25 08:35:03 UTC

lens git commit: LENS-1360 : org.apache.lens.driver.jdbc.TestJdbcDriver#testCancelQuery failing in pre-commit

Repository: lens
Updated Branches:
  refs/heads/master f274e29d5 -> 547a42f33


LENS-1360 : org.apache.lens.driver.jdbc.TestJdbcDriver#testCancelQuery failing in pre-commit


Project: http://git-wip-us.apache.org/repos/asf/lens/repo
Commit: http://git-wip-us.apache.org/repos/asf/lens/commit/547a42f3
Tree: http://git-wip-us.apache.org/repos/asf/lens/tree/547a42f3
Diff: http://git-wip-us.apache.org/repos/asf/lens/diff/547a42f3

Branch: refs/heads/master
Commit: 547a42f33caa7669fe54509e6e4dac108e904a61
Parents: f274e29
Author: Amareshwari Sriramadasu <am...@apache.org>
Authored: Tue Oct 25 14:04:45 2016 +0530
Committer: sushilmohanty <su...@apache.org>
Committed: Tue Oct 25 14:04:45 2016 +0530

----------------------------------------------------------------------
 .../org/apache/lens/driver/jdbc/JDBCDriver.java |  2 +-
 .../apache/lens/driver/jdbc/TestJdbcDriver.java |  3 +-
 lens-driver-jdbc/src/test/resources/logback.xml | 36 ++++++++++++++++++++
 3 files changed, 39 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lens/blob/547a42f3/lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java
----------------------------------------------------------------------
diff --git a/lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java b/lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java
index 82e0231..7ce1a97 100644
--- a/lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java
+++ b/lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java
@@ -290,7 +290,7 @@ public class JDBCDriver extends AbstractLensDriver {
             }
             if (queryContext.isClosed()) {
               log.info("Ignored exception on already closed query : {} - {}",
-                queryContext.getLensContext().getQueryHandle(), e.getMessage());
+                queryContext.getLensContext().getQueryHandle(), e.getMessage(), e);
             } else {
               log.error("Error executing SQL query: {} reason: {}", queryContext.getLensContext().getQueryHandle(),
                 e.getMessage(), e);

http://git-wip-us.apache.org/repos/asf/lens/blob/547a42f3/lens-driver-jdbc/src/test/java/org/apache/lens/driver/jdbc/TestJdbcDriver.java
----------------------------------------------------------------------
diff --git a/lens-driver-jdbc/src/test/java/org/apache/lens/driver/jdbc/TestJdbcDriver.java b/lens-driver-jdbc/src/test/java/org/apache/lens/driver/jdbc/TestJdbcDriver.java
index a402f91..6291021 100644
--- a/lens-driver-jdbc/src/test/java/org/apache/lens/driver/jdbc/TestJdbcDriver.java
+++ b/lens-driver-jdbc/src/test/java/org/apache/lens/driver/jdbc/TestJdbcDriver.java
@@ -834,6 +834,7 @@ public class TestJdbcDriver {
 
   public static int sleep(int t) {
     try {
+      log.info("Sleeping for {} seconds", t);
       Thread.sleep(t * 1000);
     } catch (InterruptedException ie) {
       // ignore
@@ -878,7 +879,7 @@ public class TestJdbcDriver {
     QueryHandle handle = context.getQueryHandle();
     // without wait query may not be launched.
     if (waitBeforeCancel) {
-      Thread.sleep(100);
+      Thread.sleep(1000);
     }
     boolean isCancelled = driver.cancelQuery(handle);
     driver.updateStatus(context);

http://git-wip-us.apache.org/repos/asf/lens/blob/547a42f3/lens-driver-jdbc/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/lens-driver-jdbc/src/test/resources/logback.xml b/lens-driver-jdbc/src/test/resources/logback.xml
new file mode 100644
index 0000000..eed4f66
--- /dev/null
+++ b/lens-driver-jdbc/src/test/resources/logback.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+
+-->
+<configuration>
+  <appender name="TEST_LOG_FILE" class="ch.qos.logback.core.FileAppender">
+    <file>target/test.log</file>
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%t] %-5p %c %L - %m%n</pattern>
+    </encoder>
+    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+      <level>DEBUG</level>
+    </filter>
+  </appender>
+  <root level="DEBUG">
+    <appender-ref ref="TEST_LOG_FILE"/>
+  </root>
+</configuration>
+