You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Paul Rogers (JIRA)" <ji...@apache.org> on 2016/12/02 21:31:59 UTC

[jira] [Issue Comment Deleted] (DRILL-5090) JDBC tests silently ignore failure to set up test storage plugin

     [ https://issues.apache.org/jira/browse/DRILL-5090?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Rogers updated DRILL-5090:
-------------------------------
    Comment: was deleted

(was: Some tests are failing due to new methods, with default implementations, added to {{DatabaseMetaData}} in Java 8:

* {{getMaxLogicalLobSize}}
* {{supportsRefCursors}}

These default to doing nothing and so won't throw exceptions on connection closed, etc. These need to be added to the exception mechanism in the tests.

Same is true for new Java 8 methods in other JDBC classes.)

> 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)