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

commit cfe589ca8dc4e6ead0b49ed372ea06f63bacda52
Author: Alexey Serbin <[email protected]>
AuthorDate: Tue Feb 4 17:28:35 2020 -0800

    [tests] enable TestNtpDiagnostics for 'system' time source
    
    Enable or disable HybridClockTest.TestNtpDiagnostics depending
    on whether the 'system' time source is available.
    
    This allows for running the test scenaio on macOS High Sierra
    and newer releases where the NTP kernel API is supported.
    
    This is a follow-up for e72208436a625391739217394c67d783e992367a.
    
    Change-Id: I2f2efd5de6a18b0af86429ed63ba2df7c65a1e84
    Reviewed-on: http://gerrit.cloudera.org:8080/15160
    Tested-by: Kudu Jenkins
    Reviewed-by: Adar Dembo <[email protected]>
---
 src/kudu/clock/CMakeLists.txt       | 2 +-
 src/kudu/clock/hybrid_clock-test.cc | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/kudu/clock/CMakeLists.txt b/src/kudu/clock/CMakeLists.txt
index 190698f..3ed2665 100644
--- a/src/kudu/clock/CMakeLists.txt
+++ b/src/kudu/clock/CMakeLists.txt
@@ -26,7 +26,7 @@ set(CLOCK_SRCS
 # Darwin 17 (macOS High Sierra, ver. 10.13.6) and higher supports get_ntptime()
 if (NOT APPLE OR ${CMAKE_SYSTEM_VERSION} VERSION_GREATER_EQUAL "17.0.0")
   set(CLOCK_SRCS ${CLOCK_SRCS} system_ntp.cc)
-  set_source_files_properties(hybrid_clock.cc
+  set_source_files_properties(hybrid_clock.cc hybrid_clock-test.cc
     PROPERTIES COMPILE_DEFINITIONS "KUDU_HAS_SYSTEM_TIME_SOURCE=1")
 endif()
 
diff --git a/src/kudu/clock/hybrid_clock-test.cc 
b/src/kudu/clock/hybrid_clock-test.cc
index 3873b59..422daf4 100644
--- a/src/kudu/clock/hybrid_clock-test.cc
+++ b/src/kudu/clock/hybrid_clock-test.cc
@@ -352,7 +352,7 @@ TEST_F(HybridClockTest, TestRideOverNtpInterruption) {
   ASSERT_LT(timestamps[1].ToUint64(), timestamps[2].ToUint64());
 }
 
-#ifndef __APPLE__
+#if defined(KUDU_HAS_SYSTEM_TIME_SOURCE)
 TEST_F(HybridClockTest, TestNtpDiagnostics) {
   FLAGS_time_source = "system";
   clock_.reset(new HybridClock);
@@ -365,7 +365,7 @@ TEST_F(HybridClockTest, TestNtpDiagnostics) {
   ASSERT_STR_MATCHES(s, "(ntp_gettime\\(\\) returns code |chronyc -n 
tracking)");
   ASSERT_STR_MATCHES(s, "(ntpq -n |chronyc -n sources)");
 }
-#endif
+#endif // #if defined(KUDU_HAS_SYSTEM_TIME_SOURCE) ...
 
 }  // namespace clock
 }  // namespace kudu

Reply via email to