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: [raft_consensus-itest] enable TestHammerOneRow back
Date Mon, 26 Jun 2017 20:48:59 GMT
Repository: kudu
Updated Branches:
  refs/heads/master aa0bac0cc -> 684f1fa81


[raft_consensus-itest] enable TestHammerOneRow back

This is a follow-up patch for 44bd94268c7beb08dda88bad182e177439a55c98.

Increasing the timeout for TestWorkload's write operations fixed
the issue -- no timeouts are seen after bumping timeout from 20 to
60 seconds.

Change-Id: I1de18a3ff251ef9f028ae3d60c5fa3d32b1ad527
Reviewed-on: http://gerrit.cloudera.org:8080/7289
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <todd@apache.org>


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

Branch: refs/heads/master
Commit: d5fe274dcdfa3e8716372e41266e00ccb6f769d5
Parents: aa0bac0
Author: Alexey Serbin <aserbin@cloudera.com>
Authored: Fri Jun 23 17:04:09 2017 -0700
Committer: Todd Lipcon <todd@apache.org>
Committed: Mon Jun 26 19:35:33 2017 +0000

----------------------------------------------------------------------
 .../integration-tests/raft_consensus-itest.cc   | 33 ++++++++++++--------
 1 file changed, 20 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/d5fe274d/src/kudu/integration-tests/raft_consensus-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/raft_consensus-itest.cc b/src/kudu/integration-tests/raft_consensus-itest.cc
index 7fda691..ee62c9f 100644
--- a/src/kudu/integration-tests/raft_consensus-itest.cc
+++ b/src/kudu/integration-tests/raft_consensus-itest.cc
@@ -2474,16 +2474,16 @@ TEST_F(RaftConsensusITest, TestMemoryRemainsConstantDespiteTwoDeadFollowers)
{
 }
 
 static void EnableLogLatency(server::GenericServiceProxy* proxy) {
-  typedef unordered_map<string, string> FlagMap;
-  FlagMap flags;
-  InsertOrDie(&flags, "log_inject_latency", "true");
-  InsertOrDie(&flags, "log_inject_latency_ms_mean", "1000");
-  for (const FlagMap::value_type& e : flags) {
+  const unordered_map<string, string> kFlags = {
+    { "log_inject_latency",         "true" },
+    { "log_inject_latency_ms_mean", "1000" },
+  };
+  for (const auto& e : kFlags) {
     SetFlagRequestPB req;
-    SetFlagResponsePB resp;
-    RpcController rpc;
     req.set_flag(e.first);
     req.set_value(e.second);
+    SetFlagResponsePB resp;
+    RpcController rpc;
     ASSERT_OK(proxy->SetFlag(req, &resp, &rpc));
     SCOPED_TRACE(SecureDebugString(resp));
     ASSERT_EQ(SetFlagResponsePB::SUCCESS, resp.result());
@@ -2703,25 +2703,32 @@ TEST_F(RaftConsensusITest, TestSlowFollower) {
 
 // Run a special workload that constantly updates a single row on a cluster
 // where every replica is writing to its WAL slowly.
-TEST_F(RaftConsensusITest, DISABLED_TestHammerOneRow) {
+TEST_F(RaftConsensusITest, TestHammerOneRow) {
   if (!AllowSlowTests()) return;
+
   BuildAndStart(vector<string>());
 
   for (int i = 0; i < cluster_->num_tablet_servers(); i++) {
-    ExternalTabletServer* ts = cluster_->tablet_server(i);
-    TServerDetails* follower;
-    follower = GetReplicaWithUuidOrNull(tablet_id_, ts->instance_id().permanent_uuid());
-    ASSERT_TRUE(follower);
-    NO_FATALS(EnableLogLatency(follower->generic_proxy.get()));
+    const ExternalTabletServer* ts = cluster_->tablet_server(i);
+    const TServerDetails* replica = GetReplicaWithUuidOrNull(
+        tablet_id_, ts->instance_id().permanent_uuid());
+    ASSERT_NE(nullptr, replica);
+    NO_FATALS(EnableLogLatency(replica->generic_proxy.get()));
   }
 
   TestWorkload workload(cluster_.get());
   workload.set_table_name(kTableId);
   workload.set_write_pattern(TestWorkload::UPDATE_ONE_ROW);
+  workload.set_write_timeout_millis(60000);
   workload.set_num_write_threads(20);
   workload.Setup();
   workload.Start();
   SleepFor(MonoDelta::FromSeconds(60));
+  workload.StopAndJoin();
+
+  // Ensure that the replicas converge.
+  ClusterVerifier v(cluster_.get());
+  NO_FATALS(v.CheckCluster());
 }
 
 // Test that followers that fall behind the leader's log GC threshold are


Mime
View raw message