kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From granthe...@apache.org
Subject [kudu] 01/02: [master] Change the timeout threshold for unit test case
Date Wed, 31 Jul 2019 01:40:06 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 51a0d066900fa1e9a35ab0f0fc5eff92099c8a88
Author: helifu <hzhelifu@corp.netease.com>
AuthorDate: Wed Jul 24 17:38:55 2019 +0800

    [master] Change the timeout threshold for unit test case
    
    In the previous patch, we use KUDU_ALLOW_SLOW_TEST to avoid failure
    in some environments. Now, another solution is proposed. It changes
    the timeout threshold to meet the assertion conditions.
    
    Change-Id: Ief5ec23c83022c2c5dbcc65a110ad8fe1f91f1a7
    Reviewed-on: http://gerrit.cloudera.org:8080/13909
    Tested-by: Kudu Jenkins
    Reviewed-by: Alexey Serbin <aserbin@cloudera.com>
---
 src/kudu/master/sentry_authz_provider-test.cc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/kudu/master/sentry_authz_provider-test.cc b/src/kudu/master/sentry_authz_provider-test.cc
index 2c5efed..a3a694c 100644
--- a/src/kudu/master/sentry_authz_provider-test.cc
+++ b/src/kudu/master/sentry_authz_provider-test.cc
@@ -1393,8 +1393,8 @@ TEST_F(TestSentryClientMetrics, Basic) {
   // Shorten the default timeout parameters: make timeout interval shorter.
   NO_FATALS(sentry_authz_provider_->Stop());
   FLAGS_sentry_service_rpc_addresses = sentry_->address().ToString();
-  FLAGS_sentry_service_send_timeout_seconds = AllowSlowTests() ? 5 : 2;
-  FLAGS_sentry_service_recv_timeout_seconds = AllowSlowTests() ? 5 : 2;
+  FLAGS_sentry_service_send_timeout_seconds = 2;
+  FLAGS_sentry_service_recv_timeout_seconds = 2;
   sentry_authz_provider_.reset(new SentryAuthzProvider(metric_entity_));
   ASSERT_OK(sentry_authz_provider_->Start());
 
@@ -1412,9 +1412,11 @@ TEST_F(TestSentryClientMetrics, Basic) {
   scoped_refptr<Histogram> hist(metric_entity_->FindOrCreateHistogram(
       &METRIC_sentry_client_task_execution_time_us));
   ASSERT_LT(0, hist->histogram()->MinValue());
-  ASSERT_LT(2000000, hist->histogram()->MaxValue());
+  // Change the threshold to 1900000 in case of very unstable system clock
+  // and other scheduler anomalies of the OS scheduler.
+  ASSERT_LT(1900000, hist->histogram()->MaxValue());
   ASSERT_LE(5, hist->histogram()->TotalCount());
-  ASSERT_LT(2000000, hist->histogram()->TotalSum());
+  ASSERT_LT(1900000, hist->histogram()->TotalSum());
 }
 
 enum class ThreadsNumPolicy {


Mime
View raw message