[
https://issues.apache.org/jira/browse/DRILL-5260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15881577#comment-15881577
]
ASF GitHub Bot commented on DRILL-5260:
---------------------------------------
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...)
> Refinements to new "Cluster Fixture" test framework
> ---------------------------------------------------
>
> Key: DRILL-5260
> URL: https://issues.apache.org/jira/browse/DRILL-5260
> Project: Apache Drill
> Issue Type: Improvement
> Affects Versions: 1.10
> Reporter: Paul Rogers
> Assignee: Paul Rogers
> Priority: Minor
> Fix For: 1.10
>
>
> Roll-up of a number of enhancements to the cluster fixture framework.
> * Config option to suppress printing of CSV and other output. (Allows
> printing for single tests, not printing when running from Maven.)
> * Parsing of query profiles to extract plan and run time information.
> * Fix bug in log fixture when enabling logging for a package.
> * Improved ZK support.
> * Set up the new CTTAS default temporary workspace for tests.
> * Revise TestDrillbitResiliance to use the new framework.
> * Revise TestWindowFrame to to use the new framework.
> * Revise TestMergeJoinWithSchemaChanges to use the new framework.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)