You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@orc.apache.org by do...@apache.org on 2021/12/29 20:18:42 UTC

[orc] branch branch-1.7 updated: ORC-1068: [C++] Stabilize HAS_POST_2038 test (#980)

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

dongjoon pushed a commit to branch branch-1.7
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/branch-1.7 by this push:
     new 06ade15  ORC-1068: [C++] Stabilize HAS_POST_2038 test (#980)
06ade15 is described below

commit 06ade156c2604c93fbfcc2e4c8d2969d0d856ca8
Author: Yuriy Chernyshov <ge...@gmail.com>
AuthorDate: Wed Dec 29 12:23:44 2021 +0300

    ORC-1068: [C++] Stabilize HAS_POST_2038 test (#980)
    
    On my machine (Ubuntu Focal 20.04.3, libc6=2.31-0ubuntu9.2, tzdata=2021e-0ubuntu0.20.04) the following results are returned by strptime:
    
    ```
    time2037.tm_hour = 13; // weird
    time2038.tm_hour = 12; // correct
    ```
    
    This results in time difference 31532400 (which is 3600 less than expected). Some other configurations give the expected result, thus making the build variable to flap during sequential builds on different systems.
    
    Since this is just a basic test, I suggest relaxing it a bit in order to make it stable.
    
    (cherry picked from commit ce84966a3322fd39904363c51bca418da134fd10)
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
 c++/src/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index ccb48da..d4cd035 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -157,7 +157,7 @@ CHECK_CXX_SOURCE_RUNS("
       struct tm time2038;
       strptime(\"2037-05-05 12:34:56\", \"%Y-%m-%d %H:%M:%S\", &time2037);
       strptime(\"2038-05-05 12:34:56\", \"%Y-%m-%d %H:%M:%S\", &time2038);
-      return mktime(&time2038) - mktime(&time2037) != 31536000;
+      return (mktime(&time2038) - mktime(&time2037)) <= 31500000;
     }"
   HAS_POST_2038
 )