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 2022/08/30 18:50:29 UTC

[kudu] branch master updated: [tests] fix hybrid_clock-test

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new ee186e572 [tests] fix hybrid_clock-test
ee186e572 is described below

commit ee186e572bc35040147bf03bb8f3d4f4d6267863
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Mon Aug 29 20:17:19 2022 -0700

    [tests] fix hybrid_clock-test
    
    I noticed HybridClockTest.AutoTimeSourceNoDedicatedNtpServer was failing
    from time to time on AWS instances.  It turned out the scenario missed
    setting of the fake DNS server, but the comments claimed it did.
    
    This patch addresses the issue.
    
    Change-Id: I1386646d592eb0d127a6a216664c6f241c316c6d
    Reviewed-on: http://gerrit.cloudera.org:8080/18928
    Reviewed-by: Attila Bukor <ab...@apache.org>
    Tested-by: Alexey Serbin <al...@apache.org>
---
 src/kudu/clock/hybrid_clock-test.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/kudu/clock/hybrid_clock-test.cc b/src/kudu/clock/hybrid_clock-test.cc
index c3e8996a1..80588a723 100644
--- a/src/kudu/clock/hybrid_clock-test.cc
+++ b/src/kudu/clock/hybrid_clock-test.cc
@@ -57,8 +57,10 @@
 
 DECLARE_bool(inject_unsync_time_errors);
 DECLARE_string(builtin_ntp_servers);
+DECLARE_string(cloud_curl_dns_servers_for_testing);
 DECLARE_string(time_source);
 DECLARE_uint32(cloud_metadata_server_request_timeout_ms);
+
 METRIC_DECLARE_entity(server);
 
 using kudu::cloud::InstanceDetector;
@@ -514,6 +516,10 @@ TEST_F(HybridClockTest, AutoTimeSourceNoDedicatedNtpServer) {
   // Set very short interval for the instance detection timeout.
   FLAGS_cloud_metadata_server_request_timeout_ms = 1;
 
+  // Configure a bad DNS server to ensure a timeout,
+  // even when run on fast cloud instances.
+  FLAGS_cloud_curl_dns_servers_for_testing = "192.0.2.0";
+
   {
     // Check for the pre-condition: the auto-detection fails as expected due
     // to the super-short timeout setting for the cloud metadata requests and