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

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new 446861c68 [security-itest] stop polluting TEST_TMPDIR with logs
446861c68 is described below

commit 446861c68cb3cc5e8ef8caaadf7d8eefc2ec1387
Author: Alexey Serbin <[email protected]>
AuthorDate: Tue Oct 8 15:24:42 2024 -0700

    [security-itest] stop polluting TEST_TMPDIR with logs
    
    By default, KuduTest-based scenarios have their FLAGS_log_dir pointed to
    the TEST_TMPDIR directory, so if master/tserver is run using the
    "kudu master run"/"kudu tserver run" CLI tool, the generated log files
    aren't cleaned up.  This patch addresses the issue by customizing the
    --log_dir flag to keep all the logs under the test's directory which
    is automatically removed once the scenario successfully completes.
    
    This patch addresses KUDU-3615, at least partially.
    
    Change-Id: Ib70b8a477beeab82af0ee6b4099114d5482f12cf
    Reviewed-on: http://gerrit.cloudera.org:8080/21909
    Tested-by: Alexey Serbin <[email protected]>
    Reviewed-by: KeDeng <[email protected]>
---
 src/kudu/integration-tests/security-itest.cc | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/kudu/integration-tests/security-itest.cc 
b/src/kudu/integration-tests/security-itest.cc
index 78452461b..4c027cb33 100644
--- a/src/kudu/integration-tests/security-itest.cc
+++ b/src/kudu/integration-tests/security-itest.cc
@@ -827,9 +827,16 @@ TEST_F(SecurityITest, TestWorldReadableKeytab) {
   NO_FATALS(CreateWorldReadableFile(credentials_name));
   string binary = "kudu";
   NO_FATALS(GetFullBinaryPath(&binary));
+
+  // By default, KuduTest-based scenarios have their FLAGS_log_dir pointing to
+  // the TEST_TMPDIR directory, and the generated log files aren't cleaned up.
+  // So, customize the --log_dir flag to keep all the logs under the test's
+  // directory which is automatically removed once the scenario successfully
+  // completes.
   const vector<string> argv = { binary,
                                 "master",
                                 "run",
+                                Substitute("--log_dir=$0", 
GetTestDataDirectory()),
                                 Substitute("--keytab_file=$0", 
credentials_name) };
   string stderr;
   Status s = Subprocess::Call(argv, "", nullptr, &stderr);
@@ -843,9 +850,16 @@ TEST_F(SecurityITest, TestWorldReadablePrivateKey) {
   NO_FATALS(CreateWorldReadableFile(credentials_name));
   string binary = "kudu";
   NO_FATALS(GetFullBinaryPath(&binary));
+
+  // By default, KuduTest-based scenarios have their FLAGS_log_dir pointing to
+  // the TEST_TMPDIR directory, and the generated log files aren't cleaned up.
+  // So, customize the --log_dir flag to keep all the logs under the test's
+  // directory which is automatically removed once the scenario successfully
+  // completes.
   const vector<string> argv = { binary,
                                 "master",
                                 "run",
+                                Substitute("--log_dir=$0", 
GetTestDataDirectory()),
                                 "--unlock_experimental_flags",
                                 Substitute("--rpc_private_key_file=$0", 
credentials_name),
                                 "--rpc_certificate_file=fake_file",

Reply via email to