Github user paul-rogers commented on a diff in the pull request: https://github.com/apache/drill/pull/753#discussion_r102843879 --- Diff: exec/java-exec/src/test/java/org/apache/drill/test/ClusterFixture.java --- @@ -295,8 +396,96 @@ public void close() throws Exception { if (ex != null) { throw ex; } + + // Delete any local files, if we wrote to the local + // persistent store. But, leave the files if the user wants + // to review them, for debugging, say. Note that, even if the + // files are preserved here, they will be removed when the + // next cluster fixture starts, else the CTTAS initialization + // will fail. + + if (! preserveLocalFiles) { + try { + removeLocalFiles(); + } catch (Exception e) { + ex = ex == null ? e : ex; + } + } + + // Remove temporary directories created for this cluster session. + + try { + removeTempDirs(); + } catch (Exception e) { + ex = ex == null ? e : ex; + } } + /** + * Removes files stored locally in the "local store provider." + * Required because CTTAS setup fails if these files are left from one + * run to the next. + * + * @throws IOException if a directory cannot be deleted + */ + + private void removeLocalFiles() throws IOException { + + // Don't delete if this is not a local Drillbit. + + if (! isLocal) { + return; + } + + // Don't delete if we did not write. + + if (! config.getBoolean(ExecConstants.SYS_STORE_PROVIDER_LOCAL_ENABLE_WRITE)) { + return; --- End diff -- Good point. The proper rule probably is that if we are using the local store, we need to clean it up prior to test start. Else, the new dynamic UDF stuff throw an error. So, for start-up, removes files is we are using the local store, write or not. A separate option will leave files on exit when desired. (The options to leave files us usually just turned on during debugging...)
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---