This is an automated email from the ASF dual-hosted git repository.

jieyu pushed a commit to branch 1.6.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 5176964839ad26f9046e09ad1e5b8ca62ab1cb24
Author: Jie Yu <yujie....@gmail.com>
AuthorDate: Thu Jan 10 21:02:03 2019 -0800

    Separated runtime dirs from other dirs in MesosTest.
    
    Previously, lots of other directories are created inside the agent's
    runtime_dir. This makes it hard to cleanup agent's runtime dir without
    affecting other files for the test. This patch makes the runtime
    directory a separate directory.
    
    Review: https://reviews.apache.org/r/69711
    (cherry picked from commit 07bccc6377a180267d4251897a765acba9fa0c4d)
---
 src/tests/mesos.cpp | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/tests/mesos.cpp b/src/tests/mesos.cpp
index c0ab2f7..791ec16 100644
--- a/src/tests/mesos.cpp
+++ b/src/tests/mesos.cpp
@@ -161,26 +161,26 @@ slave::Flags MesosTest::CreateSlaveFlags()
   slave::Flags flags;
 
   // Create a temporary work directory (removed by Environment).
-  Try<string> directory = environment->mkdtemp();
-  CHECK_SOME(directory) << "Failed to create temporary directory";
-  flags.work_dir = directory.get();
+  Try<string> workDir = environment->mkdtemp();
+  CHECK_SOME(workDir) << "Failed to create temporary directory";
+  flags.work_dir = workDir.get();
 
   // Create a temporary runtime directory (removed by Environment).
-  directory = environment->mkdtemp();
-  CHECK_SOME(directory) << "Failed to create temporary directory";
-  flags.runtime_dir = directory.get();
+  Try<string> runtimeDir = environment->mkdtemp();
+  CHECK_SOME(runtimeDir) << "Failed to create temporary directory";
+  flags.runtime_dir = runtimeDir.get();
 
-  flags.fetcher_cache_dir = path::join(directory.get(), "fetch");
+  flags.fetcher_cache_dir = path::join(sandbox.get(), "fetch");
 
   flags.launcher_dir = getLauncherDir();
 
-  flags.appc_store_dir = path::join(directory.get(), "store", "appc");
+  flags.appc_store_dir = path::join(sandbox.get(), "store", "appc");
 
-  flags.docker_store_dir = path::join(directory.get(), "store", "docker");
+  flags.docker_store_dir = path::join(sandbox.get(), "store", "docker");
 
   {
     // Create a default credential file for master/agent authentication.
-    const string& path = path::join(directory.get(), "credential");
+    const string& path = path::join(sandbox.get(), "credential");
 
     Try<int_fd> fd = os::open(
         path,
@@ -214,7 +214,7 @@ slave::Flags MesosTest::CreateSlaveFlags()
 
   {
     // Create a secret key for executor authentication.
-    const string path = path::join(directory.get(), "jwt_secret_key");
+    const string path = path::join(sandbox.get(), "jwt_secret_key");
 
     Try<int_fd> fd = os::open(
         path,
@@ -240,7 +240,7 @@ slave::Flags MesosTest::CreateSlaveFlags()
 
   {
     // Create a default HTTP credentials file.
-    const string& path = path::join(directory.get(), "http_credentials");
+    const string& path = path::join(sandbox.get(), "http_credentials");
 
     Try<int_fd> fd = os::open(
         path,

Reply via email to