You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by aw...@apache.org on 2020/12/02 20:32:11 UTC

[kudu] 03/03: [test] Use /tmp for mini-chronyd sockets

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

awong pushed a commit to branch branch-1.12.x
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit ec44e4d3e205eb385f22a56b04a891ffd0770131
Author: Grant Henke <gr...@apache.org>
AuthorDate: Wed Dec 2 10:55:43 2020 -0600

    [test] Use /tmp for mini-chronyd sockets
    
    To ensure the path is less than 100 bytes this patch uses /tmp instead
    of the test directory for chronyd sockets.
    
    Change-Id: I567ff640fca5c56fef3f4400216fc8b23532713e
    Reviewed-on: http://gerrit.cloudera.org:8080/16808
    Tested-by: Kudu Jenkins
    Reviewed-by: Andrew Wong <aw...@cloudera.com>
    (cherry picked from commit ef5b5abdcefbc5b7d7edb7170d55b82843926b25)
    Reviewed-on: http://gerrit.cloudera.org:8080/16812
    Reviewed-by: Alexey Serbin <as...@cloudera.com>
    Tested-by: Andrew Wong <aw...@cloudera.com>
---
 src/kudu/clock/test/mini_chronyd.cc | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/kudu/clock/test/mini_chronyd.cc b/src/kudu/clock/test/mini_chronyd.cc
index 0d2cf78..5f4cf6d 100644
--- a/src/kudu/clock/test/mini_chronyd.cc
+++ b/src/kudu/clock/test/mini_chronyd.cc
@@ -422,10 +422,8 @@ $0
     // The path to Unix domain socket file cannot be longer than ~100 bytes,
     // so it's necessary to create a directory with shorter absolute path.
     // TODO(aserbin): use some synthetic mount point instead?
-    string dir;
-    RETURN_NOT_OK(Env::Default()->GetTestDirectory(&dir));
-    dir = JoinPathSegments(dir, Substitute("$0.$1", Env::Default()->NowMicros(),
-                                           getpid()));
+    string dir = JoinPathSegments("/tmp", Substitute("$0.$1",
+        Env::Default()->NowMicros(), getpid()));
     const auto s = Env::Default()->CreateDir(dir);
     if (!s.ok() && !s.IsAlreadyPresent()) {
       return s;
@@ -433,6 +431,7 @@ $0
     RETURN_NOT_OK(CorrectOwnership(dir));
     options_.bindcmdaddress = Substitute("$0/chronyd.$1.sock",
                                          dir, options_.index);
+    // Set cmd_socket_dir_ so we can cleanup the unix domain sockets.
     cmd_socket_dir_ = std::move(dir);
   }
   string username;