Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/984#discussion_r145520129
  
    --- Diff: 
exec/java-exec/src/test/java/org/apache/drill/test/ClusterFixture.java ---
    @@ -226,43 +217,16 @@ private void createConfig(FixtureBuilder builder) 
throws Exception {
     
           serviceSet = null;
           usesZk = true;
    -      isLocal = false;
         } else {
           // Embedded Drillbit.
     
           serviceSet = RemoteServiceSet.getLocalServiceSet();
    -      isLocal = true;
         }
       }
     
    -  private void startDrillbits(FixtureBuilder builder) throws Exception {
    -//    // Ensure that Drill uses the log directory determined here rather 
than
    -//    // it's hard-coded defaults. WIP: seems to be needed some times but
    -//    // not others.
    -//
    -//    String logDir = null;
    -//    if (builder.tempDir != null) {
    -//      logDir = builder.tempDir.getAbsolutePath();
    -//    }
    -//    if (logDir == null) {
    -//      logDir = config.getString(ExecConstants.DRILL_TMP_DIR);
    -//      if (logDir != null) {
    -//        logDir += "/drill/log";
    -//      }
    -//    }
    -//    if (logDir == null) {
    -//      logDir = "/tmp/drill";
    -//    }
    -//    new File(logDir).mkdirs();
    -//    System.setProperty("drill.log-dir", logDir);
    -
    -    dfsTestTempDir = makeTempDir("dfs-test");
    -
    -    // Clean up any files that may have been left from the
    -    // last run.
    -
    -    preserveLocalFiles = builder.preserveLocalFiles;
    -    removeLocalFiles();
    +  private void startDrillbits() throws Exception {
    +    dfsTestTempDir = new File(getRootDir(), "dfs-test");
    +    dfsTestTempDir.mkdirs();
    --- End diff --
    
    Is the "preserve local files" behavior maintained? Let me explain.
    
    In automated tests, files are created, used, and discarded.
    
    But, we also use this framework for ad-hoc tests when debugging. In this 
case, we create files, end the test, and examine the files by hand. Examples: 
logs, output files, query profiles, etc.
    
    So, for this test fixture (but not for `BaseTestQuery`), we want two modes:
    
    * Normal mode: as you have implemented.
    * "Preserve local files" mode: files are written to `/tmp/drill` (or some 
other fixed, well-known location, can be within the `target` folder) and 
preserved past test exit.
    
    A method on the `FixtureBuilder` identifies which mode is desired. We turn 
on the "preserve" mode for ad-hoc tests.
    
    For more info on this framework, see [this 
description](https://github.com/paul-rogers/drill/wiki/Cluster-Fixture-Framework).


---

Reply via email to