Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5A3E0200BD4 for ; Fri, 2 Dec 2016 02:25:01 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 5901E160B0B; Fri, 2 Dec 2016 01:25:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A564B160B26 for ; Fri, 2 Dec 2016 02:25:00 +0100 (CET) Received: (qmail 567 invoked by uid 500); 2 Dec 2016 01:24:59 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 99749 invoked by uid 99); 2 Dec 2016 01:24:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Dec 2016 01:24:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 98D2B2C2A6E for ; Fri, 2 Dec 2016 01:24:58 +0000 (UTC) Date: Fri, 2 Dec 2016 01:24:58 +0000 (UTC) From: "Paul Rogers (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-5090) JDBC tests silently ignore failure to set up test storage plugin MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 02 Dec 2016 01:25:01 -0000 [ https://issues.apache.org/jira/browse/DRILL-5090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15713647#comment-15713647 ] Paul Rogers commented on DRILL-5090: ------------------------------------ Further tests show that the {{StoragePluginRegistryImpl.createPlugins()}} method does not load the test bootstrap plugins because the local plugin directory already exists: {{/tmp/drill/sys.storage_plugins}}. Not sure how this could have ever worked if this directory exists and has contents: {code} cp.sys.drill dfs.sys.drill s3.sys.drill {code} These may have been created when running other unit tests. How are they being cleaned up for folks for whom the JDBC unit tests succeed? > JDBC tests silently ignore failure to set up test storage plugin > ---------------------------------------------------------------- > > Key: DRILL-5090 > URL: https://issues.apache.org/jira/browse/DRILL-5090 > Project: Apache Drill > Issue Type: Bug > Affects Versions: 1.8.0 > Reporter: Paul Rogers > > Run the {{TestJDBCQuery}} test cases using Java 8. The tests will fail with error such as: > {code} > VALIDATION ERROR ... > Current default schema: No default schema selected > {code} > The problem is that the tests try to set up a test schema, but fail. The code that does this setup just silently ignores the error: > {code} > try { > TestUtilities.updateDfsTestTmpSchemaLocation(pluginRegistry, tmpDirPath); > TestUtilities.makeDfsTmpSchemaImmutable(pluginRegistry); > } > } catch(Throwable e) { > // ... This is unlikely to > // happen, but just a safeguard to avoid failing user applications. > logger.warn("Failed to update tmp schema locations. This step is purely for testing purpose. " + > "Shouldn't be seen in production code."); > // Ignore the error and go with defaults > } > {code} > The reason that the error is ignored is that the JDBC driver _itself_ contains test code in the form of the following check: > {code} > if (props != null && "true".equalsIgnoreCase(props.getProperty("drillJDBCUnitTests"))) { > {code} > That is, the JDBC driver itself contains the code needed to set up the test schemas. This means that test code is shipped in production. And, we must handle the failure gracefully in case the user set the property in production. > Requested changes: > * Find a way to do test setup without including test code in JDBC. > * If test setup fails, issue a fatal error to direct the developer to the actual problem. > And, of course, fix the Java 8 error so that the tests pass. Fixing that error is a separate issue. If things were to fail again, we need the above fixes to avoid wasting developer's time finding the problem. -- This message was sent by Atlassian JIRA (v6.3.4#6332)