You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2017/06/22 21:19:59 UTC

[4/4] kudu git commit: [client-test] fixing flakes in the test

[client-test] fixing flakes in the test

Extended timeout for table creation up to 60 seconds in couple of places
where dist-test reports intermittent timeouts.

Added print-out of the session errors if the actual number of session
errors differs from the expected one
(that's for TestAutoFlushBackgroundAndErrorCollector)

Change-Id: Ic0203e62ec8ee445201e385816f3c05c2594356d
Reviewed-on: http://gerrit.cloudera.org:8080/7263
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>


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

Branch: refs/heads/master
Commit: d2b8205941d22ba8ffc5d105b3612ecdc58e9fd7
Parents: c257785
Author: Alexey Serbin <as...@cloudera.com>
Authored: Thu Jun 22 08:19:52 2017 -0700
Committer: Alexey Serbin <as...@cloudera.com>
Committed: Thu Jun 22 21:08:14 2017 +0000

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


http://git-wip-us.apache.org/repos/asf/kudu/blob/d2b82059/src/kudu/client/client-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client-test.cc b/src/kudu/client/client-test.cc
index a7c5070..a019f0d 100644
--- a/src/kudu/client/client-test.cc
+++ b/src/kudu/client/client-test.cc
@@ -562,6 +562,7 @@ class ClientTest : public KuduTest {
                             .schema(&schema_)
                             .num_replicas(num_replicas)
                             .set_range_partition_columns({ "key" })
+                            .timeout(MonoDelta::FromSeconds(60))
                             .Create());
 
     ASSERT_OK(client_->OpenTable(table_name, table));
@@ -2726,7 +2727,6 @@ TEST_F(ClientTest, TestAutoFlushBackgroundAndErrorCollector) {
     }
 
     void AddError(unique_ptr<KuduError> error) override {
-      //LOG(INFO) << "Hello from: " << Thread::UniqueThreadId();
       if (0 == error_cnt_++) {
         const bool prev_allowed = ThreadRestrictions::SetWaitAllowed(true);
         SleepFor(MonoDelta::FromSeconds(1));
@@ -2768,7 +2768,15 @@ TEST_F(ClientTest, TestAutoFlushBackgroundAndErrorCollector) {
     bool overflowed;
     session->GetPendingErrors(&errors, &overflowed);
     ASSERT_FALSE(overflowed);
-    ASSERT_EQ(kRowNum, errors.size());
+    // Print out the errors if the expected count differs from the actual one.
+    if (kRowNum != errors.size()) {
+      vector<string> errors_str;
+      for (const auto e : errors) {
+        errors_str.push_back(Substitute("status: $0; operation: $1",
+            e->status().ToString(), e->failed_op().ToString()));
+      }
+      EXPECT_EQ(kRowNum, errors.size()) << errors_str;
+    }
   }
 }
 
@@ -5120,7 +5128,7 @@ static const ServiceUnavailableRetryParams service_unavailable_retry_cases[] = {
   // request for long enough time.
   {
     MonoDelta::FromSeconds(1),        // usurper_sleep
-    MonoDelta::FromSeconds(10),       // client_timeout
+    MonoDelta::FromSeconds(60),       // client_timeout
     &Status::ok,                      // status_check
   },
 };