kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject [1/2] kudu git commit: [tests] operations timeout for ClusterVerifier
Date Mon, 15 May 2017 22:47:53 GMT
Repository: kudu
Updated Branches:
  refs/heads/master b28a59266 -> 0230ca58a


[tests] operations timeout for ClusterVerifier

Change-Id: I90828d0bd91809fe541782f4e5ded06cbae51873
Reviewed-on: http://gerrit.cloudera.org:8080/6888
Tested-by: Alexey Serbin <aserbin@cloudera.com>
Reviewed-by: Dan Burkert <danburkert@apache.org>


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

Branch: refs/heads/master
Commit: af9bcf29e99671c2a5e8e28895f30db22583efdc
Parents: b28a592
Author: Alexey Serbin <aserbin@cloudera.com>
Authored: Sun May 14 22:01:23 2017 -0700
Committer: Alexey Serbin <aserbin@cloudera.com>
Committed: Mon May 15 22:47:04 2017 +0000

----------------------------------------------------------------------
 src/kudu/integration-tests/cluster_verifier.cc | 23 ++++++++++++++-------
 src/kudu/integration-tests/cluster_verifier.h  |  8 +++++--
 2 files changed, 21 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/af9bcf29/src/kudu/integration-tests/cluster_verifier.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/cluster_verifier.cc b/src/kudu/integration-tests/cluster_verifier.cc
index 1b38951..f13a7f0 100644
--- a/src/kudu/integration-tests/cluster_verifier.cc
+++ b/src/kudu/integration-tests/cluster_verifier.cc
@@ -15,17 +15,18 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <gtest/gtest.h>
-#include <string>
 #include <memory>
+#include <string>
 #include <vector>
 
+#include <gtest/gtest.h>
+
 #include "kudu/client/client.h"
 #include "kudu/client/row_result.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/integration-tests/cluster_verifier.h"
-#include "kudu/integration-tests/log_verifier.h"
 #include "kudu/integration-tests/external_mini_cluster.h"
+#include "kudu/integration-tests/log_verifier.h"
 #include "kudu/tools/ksck_remote.h"
 #include "kudu/util/monotime.h"
 #include "kudu/util/test_util.h"
@@ -42,12 +43,14 @@ using tools::KsckMaster;
 using tools::RemoteKsckMaster;
 
 ClusterVerifier::ClusterVerifier(ExternalMiniCluster* cluster)
-  : cluster_(cluster),
-    checksum_options_(ChecksumOptions()) {
+    : cluster_(cluster),
+      checksum_options_(ChecksumOptions()),
+      operations_timeout_(MonoDelta::FromSeconds(60)) {
   checksum_options_.use_snapshot = false;
 }
 
-ClusterVerifier::~ClusterVerifier() {
+void ClusterVerifier::SetOperationsTimeout(const MonoDelta& timeout) {
+  operations_timeout_ = timeout;
 }
 
 void ClusterVerifier::SetVerificationTimeout(const MonoDelta& timeout) {
@@ -117,8 +120,12 @@ Status ClusterVerifier::DoCheckRowCount(const std::string& table_name,
                                         ComparisonMode mode,
                                         int expected_row_count) {
   client::sp::shared_ptr<client::KuduClient> client;
-  RETURN_NOT_OK_PREPEND(cluster_->CreateClient(nullptr, &client),
-                        "Unable to connect to cluster");
+  RETURN_NOT_OK_PREPEND(cluster_->CreateClient(
+      &client::KuduClientBuilder()
+          .default_admin_operation_timeout(operations_timeout_)
+          .default_rpc_timeout(operations_timeout_),
+      &client),
+      "Unable to connect to cluster");
   client::sp::shared_ptr<client::KuduTable> table;
   RETURN_NOT_OK_PREPEND(client->OpenTable(table_name, &table),
                         "Unable to open table");

http://git-wip-us.apache.org/repos/asf/kudu/blob/af9bcf29/src/kudu/integration-tests/cluster_verifier.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/cluster_verifier.h b/src/kudu/integration-tests/cluster_verifier.h
index 8dc1516..14d5499 100644
--- a/src/kudu/integration-tests/cluster_verifier.h
+++ b/src/kudu/integration-tests/cluster_verifier.h
@@ -35,14 +35,16 @@ class MonoDelta;
 class ClusterVerifier {
  public:
   explicit ClusterVerifier(ExternalMiniCluster* cluster);
-  ~ClusterVerifier();
+
+  // Set the timeout for read/write/admin operations.
+  void SetOperationsTimeout(const MonoDelta& timeout);
 
   // Set the amount of time which we'll retry trying to verify the cluster
   // state. We retry because it's possible that one of the replicas is behind
   // but in the process of catching up.
   void SetVerificationTimeout(const MonoDelta& timeout);
 
-  /// Set the number of concurrent scans to execute per tablet server.
+  // Set the number of concurrent scans to execute per tablet server.
   void SetScanConcurrency(int concurrency);
 
   // Verify that the cluster is in good state. Triggers a gtest assertion failure
@@ -88,6 +90,8 @@ class ClusterVerifier {
 
   ExternalMiniCluster* cluster_;
 
+  MonoDelta operations_timeout_;
+
   ChecksumOptions checksum_options_;
 
   DISALLOW_COPY_AND_ASSIGN(ClusterVerifier);


Mime
View raw message