You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by la...@apache.org on 2023/11/06 05:02:34 UTC

(kudu) branch master updated (d4023e4af -> 7bc13ef92)

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

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


    from d4023e4af KUDU-3522 Fail early when encryption init fails
     new 0ce3e14f4 Fix the missing parameterized unit test
     new 7bc13ef92 Minor refactoring on kudu-tool-test (take 2)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/kudu/integration-tests/ts_recovery-itest.cc |  2 +-
 src/kudu/tools/kudu-tool-test.cc                | 12 +-----------
 src/kudu/tools/tool_test_util.cc                | 17 ++++++++++++++++-
 3 files changed, 18 insertions(+), 13 deletions(-)


(kudu) 01/02: Fix the missing parameterized unit test

Posted by la...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0ce3e14f4d9d2f70cfa87952fb83df1e2f619945
Author: Yingchun Lai <la...@apache.org>
AuthorDate: Sun Nov 5 23:33:56 2023 +0800

    Fix the missing parameterized unit test
    
    Change-Id: Id06947846a401183d00e00bf43d7cf4d86002232
    Reviewed-on: http://gerrit.cloudera.org:8080/20656
    Tested-by: Yingchun Lai <la...@apache.org>
    Reviewed-by: Yifan Zhang <ch...@163.com>
---
 src/kudu/integration-tests/ts_recovery-itest.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/kudu/integration-tests/ts_recovery-itest.cc b/src/kudu/integration-tests/ts_recovery-itest.cc
index 31d630c3f..df7eaef90 100644
--- a/src/kudu/integration-tests/ts_recovery-itest.cc
+++ b/src/kudu/integration-tests/ts_recovery-itest.cc
@@ -146,7 +146,7 @@ void TsRecoveryITest::StartClusterOneTs(vector<string> extra_tserver_flags,
 // being unable to complete replay of the WAL and leaves the WAL recovery directory in place.
 // 3. The master should tombstone the FAILED replica, causing its recovery directory to be deleted.
 // A subsequent tablet copy and tablet bootstrap should cause the replica to become healthy again.
-TEST_F(TsRecoveryITest, TestTabletRecoveryAfterSegmentDelete) {
+TEST_P(TsRecoveryITest, TestTabletRecoveryAfterSegmentDelete) {
   // Start a cluster with 3 tablet servers consisting of 1 tablet with 3 replicas.
   // Configure a small log segment size to quickly create new log segments.
   // Since we want to write as quickly as possible, we disable WAL compression.


(kudu) 02/02: Minor refactoring on kudu-tool-test (take 2)

Posted by la...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 7bc13ef925b7be11c315745d335e8a5e277890e8
Author: Yingchun Lai <la...@apache.org>
AuthorDate: Sun Nov 5 23:12:24 2023 +0800

    Minor refactoring on kudu-tool-test (take 2)
    
    Move the parameterize logic of kudu-tool-test
    from kudu-tool-test.cc to tool_test_util.cc,
    the latter one is more general because the
    RunKuduTool() in tool_test_util.cc is a more
    general utility which is called in mutiple
    test files.
    
    Change-Id: I86d2120aa689473495ec8d4604caee1123060663
    Reviewed-on: http://gerrit.cloudera.org:8080/20655
    Tested-by: Kudu Jenkins
    Reviewed-by: Yifan Zhang <ch...@163.com>
---
 src/kudu/tools/kudu-tool-test.cc | 12 +-----------
 src/kudu/tools/tool_test_util.cc | 17 ++++++++++++++++-
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/src/kudu/tools/kudu-tool-test.cc b/src/kudu/tools/kudu-tool-test.cc
index 4a0b3fc75..3aea9dcdc 100644
--- a/src/kudu/tools/kudu-tool-test.cc
+++ b/src/kudu/tools/kudu-tool-test.cc
@@ -271,17 +271,7 @@ class ToolTest : public KuduTest {
                  const string& in = "") const {
     string out;
     string err;
-    string args(arg_str);
-    // Pass the flags to the CLI tools. Now only --encrypt_data_at_rest and
-    // --enable_multi_tenancy flags are passed by default, the other flags
-    // are needed to be passed manually by adding them in 'arg_str'.
-    if (FLAGS_encrypt_data_at_rest) {
-      args += " --encrypt_data_at_rest";
-    }
-    if (FLAGS_enable_multi_tenancy) {
-      args += " --enable_multi_tenancy --unlock_experimental_flags";
-    }
-    Status s = RunKuduTool(strings::Split(args, " ", strings::SkipEmpty()),
+    Status s = RunKuduTool(strings::Split(arg_str, " ", strings::SkipEmpty()),
                            &out, &err, in);
     if (stdout) {
       *stdout = out;
diff --git a/src/kudu/tools/tool_test_util.cc b/src/kudu/tools/tool_test_util.cc
index 6d4f1179f..341f522ec 100644
--- a/src/kudu/tools/tool_test_util.cc
+++ b/src/kudu/tools/tool_test_util.cc
@@ -23,6 +23,7 @@
 #include <utility>
 #include <vector>
 
+#include <gflags/gflags.h>
 #include <glog/logging.h>
 
 #include "kudu/gutil/strings/split.h"
@@ -37,6 +38,10 @@ using std::vector;
 using strings::Split;
 using strings::Substitute;
 
+DECLARE_bool(enable_multi_tenancy);
+DECLARE_bool(encrypt_data_at_rest);
+DECLARE_string(block_manager);
+
 namespace kudu {
 namespace tools {
 
@@ -50,7 +55,8 @@ Status RunKuduTool(const vector<string>& args, string* out, string* err,
                    const string& in, map<string, string> env_vars) {
   vector<string> total_args = { GetKuduToolAbsolutePath() };
 
-  // Some scenarios might add unsafe flags for testing purposes.
+  // Some scenarios might add experimental or unsafe flags for testing purposes.
+  total_args.emplace_back("--unlock_experimental_flags");
   total_args.emplace_back("--unlock_unsafe_flags");
 
   // Speed up filesystem-based operations.
@@ -68,6 +74,15 @@ Status RunKuduTool(const vector<string>& args, string* out, string* err,
   // side as well to allow clients to accept and verify TLS certificates.
   total_args.emplace_back("--openssl_security_level_override=0");
 
+  // Pass some flags to the CLI tools for testing purposes.
+  // Now only --encrypt_data_at_rest, --enable_multi_tenancy and --block_manager
+  // flags are passed by default.
+  total_args.emplace_back(Substitute("--encrypt_data_at_rest=$0",
+                                     FLAGS_encrypt_data_at_rest));
+  total_args.emplace_back(Substitute("--enable_multi_tenancy=$0",
+                                     FLAGS_enable_multi_tenancy));
+  total_args.emplace_back(Substitute("--block_manager=$0", FLAGS_block_manager));
+
   total_args.insert(total_args.end(), args.begin(), args.end());
   return Subprocess::Call(total_args, in, out, err, std::move(env_vars));
 }