Github user sohami commented on a diff in the pull request:

    https://github.com/apache/drill/pull/753#discussion_r102584427
  
    --- 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 --
    
    If the previous test wants to preserve the file then we will not delete 
upon cluster shutdown. But then if next test starts and doesn't want to save 
profiles this option will be `false` by default and on cluster startup we will 
still not delete the old files ? which is the intention in `startDrillbits()`


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

Reply via email to