You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by to...@apache.org on 2017/08/28 19:31:13 UTC

kudu git commit: KUDU-2089: Failed java tests can orphan test-tmp files

Repository: kudu
Updated Branches:
  refs/heads/master 22a19d93a -> c7a22fa6b


KUDU-2089: Failed java tests can orphan test-tmp files

This changes the MiniKuduCluster code to add the paths to pathsToDelete
before calling configureAndStartProcess.

If configureAndStartProcess throws an exception, the test-tmp files will
be still deleted during shutdown.

Change-Id: I53c04987b6683dc959c319d384657c28b4671168
Reviewed-on: http://gerrit.cloudera.org:8080/7719
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <to...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/c7a22fa6
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/c7a22fa6
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/c7a22fa6

Branch: refs/heads/master
Commit: c7a22fa6b51d8b54a3eb49800a575993a460adc4
Parents: 22a19d9
Author: Jun He <ju...@gmail.com>
Authored: Fri Aug 18 00:12:48 2017 -0700
Committer: Todd Lipcon <to...@apache.org>
Committed: Mon Aug 28 19:20:43 2017 +0000

----------------------------------------------------------------------
 .../java/org/apache/kudu/client/MiniKuduCluster.java    | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/c7a22fa6/java/kudu-client/src/test/java/org/apache/kudu/client/MiniKuduCluster.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/MiniKuduCluster.java b/java/kudu-client/src/test/java/org/apache/kudu/client/MiniKuduCluster.java
index eab429b..67b3a00 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/MiniKuduCluster.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/MiniKuduCluster.java
@@ -234,14 +234,14 @@ public class MiniKuduCluster implements AutoCloseable {
 
       commandLine.addAll(extraMasterFlags);
 
-      masterProcesses.put(port, configureAndStartProcess(port, commandLine));
-      commandLines.put(port, commandLine);
-
       if (flagsPath.startsWith(baseDirPath)) {
         // We made a temporary copy of the flags; delete them later.
         pathsToDelete.add(flagsPath);
       }
       pathsToDelete.add(masterBaseDirPath);
+
+      masterProcesses.put(port, configureAndStartProcess(port, commandLine));
+      commandLines.put(port, commandLine);
     }
     // Return next port number.
     return ports.get(ports.size() - 1) + 1;
@@ -300,14 +300,14 @@ public class MiniKuduCluster implements AutoCloseable {
 
       commandLine.addAll(extraTserverFlags);
 
-      tserverProcesses.put(rpcPort, configureAndStartProcess(rpcPort, commandLine));
-      commandLines.put(rpcPort, commandLine);
-
       if (flagsPath.startsWith(baseDirPath)) {
         // We made a temporary copy of the flags; delete them later.
         pathsToDelete.add(flagsPath);
       }
       pathsToDelete.add(tsBaseDirPath);
+
+      tserverProcesses.put(rpcPort, configureAndStartProcess(rpcPort, commandLine));
+      commandLines.put(rpcPort, commandLine);
     }
     // Return next port number.
     return ports.get(ports.size() - 1) + 1;