drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Rogers (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-5090) JDBC tests silently ignore failure to set up test storage plugin
Date Thu, 01 Dec 2016 22:50:58 GMT
Paul Rogers created DRILL-5090:

             Summary: 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:

Current default schema: No default schema selected

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:

    try {
        TestUtilities.updateDfsTestTmpSchemaLocation(pluginRegistry, tmpDirPath);
    } 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

The reason that the error is ignored is that the JDBC driver _itself_ contains test code in
the form of the following check:

      if (props != null && "true".equalsIgnoreCase(props.getProperty("drillJDBCUnitTests")))

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

View raw message