Repository: kudu
Updated Branches:
  refs/heads/master b069dd28b -> ffb8fd967


[client-test] faster TestFlushModesCompareOpRates*

Use smaller mutation buffer size and apply fewer write operations
in TestFlushModesCompareOpRates{FixedSize, RandomSize} tests.
This makes then run significantly faster in ASAN and TSAN builds.

Change-Id: I1d260ac87b2daecbc97803a4663e80978b65b8f1
Reviewed-on: http://gerrit.cloudera.org:8080/4437
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <a...@cloudera.com>


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

Branch: refs/heads/master
Commit: ffb8fd967ae9fc31c6a33f814a1f02aa5472bbd8
Parents: b069dd2
Author: Alexey Serbin <aser...@cloudera.com>
Authored: Thu Sep 15 22:33:50 2016 -0700
Committer: Adar Dembo <a...@cloudera.com>
Committed: Fri Sep 16 23:09:06 2016 +0000

----------------------------------------------------------------------
 src/kudu/client/client-test.cc | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/ffb8fd96/src/kudu/client/client-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client-test.cc b/src/kudu/client/client-test.cc
index daf4629..6c08cbf 100644
--- a/src/kudu/client/client-test.cc
+++ b/src/kudu/client/client-test.cc
@@ -2264,6 +2264,8 @@ void ClientTest::TimeInsertOpBatch(
   const size_t row_num = string_sizes.size();
   shared_ptr<KuduSession> session(client_->NewSession());
   ASSERT_OK(session->SetMutationBufferSpace(buffer_size));
+  ASSERT_OK(session->SetMutationBufferFlushWatermark(0.5));
+  ASSERT_OK(session->SetMutationBufferMaxNum(2));
   ASSERT_OK(session->SetFlushMode(mode));
   Stopwatch sw(Stopwatch::ALL_THREADS);
   LOG_TIMING(INFO, "Running in " + mode_str + " mode") {
@@ -2388,10 +2390,10 @@ TEST_F(ClientTest, TestSessionMutationBufferMaxNum) {
 // in AUTO_FLUSH and AUTO_FLUSH_BACKGROUND mode; all the operations have
 // the same pre-defined size.
 TEST_F(ClientTest, TestFlushModesCompareOpRatesFixedSize) {
-  const size_t kBufferSizeBytes = 32 * 1024;
-  const size_t kRowNum = 4 * 1024;
+  const size_t kBufferSizeBytes = 1024;
+  const size_t kRowNum = 256;
 
-  vector<size_t> str_sizes(kRowNum, kBufferSizeBytes / 8);
+  vector<size_t> str_sizes(kRowNum, kBufferSizeBytes / 128);
   CpuTimes t_afb;
   TimeInsertOpBatch(KuduSession::AUTO_FLUSH_BACKGROUND,
                     kBufferSizeBytes, 0, 2, str_sizes,
@@ -2407,13 +2409,13 @@ TEST_F(ClientTest, 
TestFlushModesCompareOpRatesFixedSize) {
 // A test scenario to compare rate of submission of small write operations
 // in AUTO_FLUSH and AUTO_FLUSH_BACKGROUND mode with operations of random size.
 TEST_F(ClientTest, TestFlushModesCompareOpRatesRandomSize) {
-  const size_t kBufferSizeBytes = 32 * 1024;
-  const size_t kRowNum = 4 * 1024;
+  const size_t kBufferSizeBytes = 1024;
+  const size_t kRowNum = 256;
 
   SeedRandom();
   vector<size_t> str_sizes(kRowNum);
   for (size_t i = 0; i < kRowNum; ++i) {
-    str_sizes[i] = rand() % (kBufferSizeBytes / 8);
+    str_sizes[i] = rand() % (kBufferSizeBytes / 128);
   }
   CpuTimes t_afb;
   TimeInsertOpBatch(KuduSession::AUTO_FLUSH_BACKGROUND,

Reply via email to