Icinga / icinga2

The core of our monitoring platform with a powerful configuration language and REST API.
https://icinga.com/docs/icinga2/latest
GNU General Public License v2.0
2.03k stars 578 forks source link

icinga_legacytimeperiod/dst unit test fails on Mac #9801

Open Al2Klimov opened 1 year ago

Al2Klimov commented 1 year ago

Confirmed by @yhabteab.

I've commented it out for now, but someone should have a look at it one nice day.

julianbrost commented 1 year ago

How does it fail? Did it work at some point?

yhabteab commented 1 year ago

Did it work at some point?

Yes.

How does it fail?

~/Workspace/icinga2 (master ✗) cat /Users/yhabteab/Workspace/icinga2/build/Testing/Temporary/LastTest.log | grep 'icinga_legacytimeperiod'
93/119 Testing: base-icinga_legacytimeperiod/simple
93/119 Test: base-icinga_legacytimeperiod/simple
Command: "/Users/yhabteab/Workspace/icinga2/build/Bin/Debug/boosttest-test-base" "--run_test=icinga_legacytimeperiod/simple" "--catch_system_error=yes"
"base-icinga_legacytimeperiod/simple" start time: Jun 23 13:04 CEST
"base-icinga_legacytimeperiod/simple" end time: Jun 23 13:04 CEST
"base-icinga_legacytimeperiod/simple" time elapsed: 00:00:00
94/119 Testing: base-icinga_legacytimeperiod/advanced
94/119 Test: base-icinga_legacytimeperiod/advanced
Command: "/Users/yhabteab/Workspace/icinga2/build/Bin/Debug/boosttest-test-base" "--run_test=icinga_legacytimeperiod/advanced" "--catch_system_error=yes"
"base-icinga_legacytimeperiod/advanced" start time: Jun 23 13:04 CEST
"base-icinga_legacytimeperiod/advanced" end time: Jun 23 13:04 CEST
"base-icinga_legacytimeperiod/advanced" time elapsed: 00:00:00
95/119 Testing: base-icinga_legacytimeperiod/dst
95/119 Test: base-icinga_legacytimeperiod/dst
Command: "/Users/yhabteab/Workspace/icinga2/build/Bin/Debug/boosttest-test-base" "--run_test=icinga_legacytimeperiod/dst" "--catch_system_error=yes"
"base-icinga_legacytimeperiod/dst" start time: Jun 23 13:04 CEST
/Users/yhabteab/Workspace/icinga2/test/icinga-legacytimeperiod.cpp:624: error: in "icinga_legacytimeperiod/dst": FindRunningSegment(day='2021-11-07' ranges='01:15-01:45' ref='2021-11-07 01:30:00 PDT'): got=(2021-11-07 01:15:00 PDT (1636272900) .. 2021-11-07 01:45:00 PST (1636278300)) expected=(2021-11-07 01:15:00 PDT (1636272900) .. 2021-11-07 01:45:00 PDT (1636274700))
/Users/yhabteab/Workspace/icinga2/test/icinga-legacytimeperiod.cpp:642: error: in "icinga_legacytimeperiod/dst": FindNextSegment(day='2021-11-07' ranges='01:15-01:45' ref='2021-11-07 01:00:00 PDT'): got=(2021-11-07 01:15:00 PDT (1636272900) .. 2021-11-07 01:45:00 PST (1636278300)) expected=(2021-11-07 01:15:00 PDT (1636272900) .. 2021-11-07 01:45:00 PDT (1636274700))
/Users/yhabteab/Workspace/icinga2/test/icinga-legacytimeperiod.cpp:624: error: in "icinga_legacytimeperiod/dst": FindRunningSegment(day='2021-11-07' ranges='01:15-01:45' ref='2021-11-07 01:30:00 PST'): got=(2021-11-07 01:15:00 PDT (1636272900) .. 2021-11-07 01:45:00 PST (1636278300)) expected=none
"base-icinga_legacytimeperiod/dst" end time: Jun 23 13:04 CEST
"base-icinga_legacytimeperiod/dst" time elapsed: 00:00:00
96/119 Testing: base-icinga_legacytimeperiod/dst_isinside
96/119 Test: base-icinga_legacytimeperiod/dst_isinside
Command: "/Users/yhabteab/Workspace/icinga2/build/Bin/Debug/boosttest-test-base" "--run_test=icinga_legacytimeperiod/dst_isinside" "--catch_system_error=yes"
"base-icinga_legacytimeperiod/dst_isinside" start time: Jun 23 13:04 CEST
"base-icinga_legacytimeperiod/dst_isinside" end time: Jun 23 13:04 CEST
"base-icinga_legacytimeperiod/dst_isinside" time elapsed: 00:00:00
Al2Klimov commented 1 year ago

Did it work at some point?

Yes.

You mean like

? Doesn’t work for me:

        Start  95: base-icinga_legacytimeperiod/dst
 95/119 Test  #95: base-icinga_legacytimeperiod/dst ........................................***Failed    0.27 sec
Running 1 test case...
/Users/aklimov/NET/WS/icinga2/hotspare/test/icinga-legacytimeperiod.cpp:624: error: in "icinga_legacytimeperiod/dst": FindRunningSegment(day='2021-11-07' ranges='01:15-01:45' ref='2021-11-07 01:30:00 PDT'): got=(2021-11-07 01:15:00 PDT (1636272900) .. 2021-11-07 01:45:00 PST (1636278300)) expected=(2021-11-07 01:15:00 PDT (1636272900) .. 2021-11-07 01:45:00 PDT (1636274700))
/Users/aklimov/NET/WS/icinga2/hotspare/test/icinga-legacytimeperiod.cpp:642: error: in "icinga_legacytimeperiod/dst": FindNextSegment(day='2021-11-07' ranges='01:15-01:45' ref='2021-11-07 01:00:00 PDT'): got=(2021-11-07 01:15:00 PDT (1636272900) .. 2021-11-07 01:45:00 PST (1636278300)) expected=(2021-11-07 01:15:00 PDT (1636272900) .. 2021-11-07 01:45:00 PDT (1636274700))
/Users/aklimov/NET/WS/icinga2/hotspare/test/icinga-legacytimeperiod.cpp:624: error: in "icinga_legacytimeperiod/dst": FindRunningSegment(day='2021-11-07' ranges='01:15-01:45' ref='2021-11-07 01:30:00 PST'): got=(2021-11-07 01:15:00 PDT (1636272900) .. 2021-11-07 01:45:00 PST (1636278300)) expected=none

*** 3 failures are detected in the test module "icinga2"

        Start  96: base-icinga_legacytimeperiod/dst_isinside
 96/119 Test  #96: base-icinga_legacytimeperiod/dst_isinside ...............................   Passed    0.54 sec
        Start  97: base-icinga_perfdata/empty
 97/119 Test  #97: base-icinga_perfdata/empty ..............................................   Passed    0.25 sec
        Start  98: base-icinga_perfdata/simple
 98/119 Test  #98: base-icinga_perfdata/simple .............................................   Passed    0.25 sec
        Start  99: base-icinga_perfdata/quotes
 99/119 Test  #99: base-icinga_perfdata/quotes .............................................   Passed    0.25 sec
        Start 100: base-icinga_perfdata/multiple
100/119 Test #100: base-icinga_perfdata/multiple ...........................................   Passed    0.25 sec
        Start 101: base-icinga_perfdata/multiline
101/119 Test #101: base-icinga_perfdata/multiline ..........................................   Passed    0.25 sec
        Start 102: base-icinga_perfdata/normalize
102/119 Test #102: base-icinga_perfdata/normalize ..........................................   Passed    0.24 sec
        Start 103: base-icinga_perfdata/uom
103/119 Test #103: base-icinga_perfdata/uom ................................................   Passed    0.25 sec
        Start 104: base-icinga_perfdata/warncritminmax
104/119 Test #104: base-icinga_perfdata/warncritminmax .....................................   Passed    0.25 sec
        Start 105: base-icinga_perfdata/ignore_invalid_warn_crit_min_max
105/119 Test #105: base-icinga_perfdata/ignore_invalid_warn_crit_min_max ...................   Passed    0.24 sec
        Start 106: base-icinga_perfdata/invalid
106/119 Test #106: base-icinga_perfdata/invalid ............................................   Passed    0.25 sec
        Start 107: base-icinga_perfdata/multi
107/119 Test #107: base-icinga_perfdata/multi ..............................................   Passed    0.25 sec
        Start 108: base-icinga_perfdata/scientificnotation
108/119 Test #108: base-icinga_perfdata/scientificnotation .................................   Passed    0.24 sec
        Start 109: base-icinga_perfdata/parse_edgecases
109/119 Test #109: base-icinga_perfdata/parse_edgecases ....................................   Passed    0.24 sec
        Start 110: base-remote_configpackageutility/ValidateName
110/119 Test #110: base-remote_configpackageutility/ValidateName ...........................   Passed    0.24 sec
        Start 111: base-remote_url/id_and_path
111/119 Test #111: base-remote_url/id_and_path .............................................   Passed    0.24 sec
        Start 112: base-remote_url/parameters
112/119 Test #112: base-remote_url/parameters ..............................................   Passed    0.24 sec
        Start 113: base-remote_url/get_and_set
113/119 Test #113: base-remote_url/get_and_set .............................................   Passed    0.24 sec
        Start 114: base-remote_url/format
114/119 Test #114: base-remote_url/format ..................................................   Passed    0.24 sec
        Start 115: base-remote_url/illegal_legal_strings
115/119 Test #115: base-remote_url/illegal_legal_strings ...................................   Passed    0.24 sec
        Start 116: icinga_checkable-icinga_checkable_flapping/host_not_flapping
116/119 Test #116: icinga_checkable-icinga_checkable_flapping/host_not_flapping ............   Passed    1.55 sec
        Start 117: icinga_checkable-icinga_checkable_flapping/host_flapping
117/119 Test #117: icinga_checkable-icinga_checkable_flapping/host_flapping ................   Passed    0.24 sec
        Start 118: icinga_checkable-icinga_checkable_flapping/host_flapping_recover
118/119 Test #118: icinga_checkable-icinga_checkable_flapping/host_flapping_recover ........   Passed    0.24 sec
        Start 119: icinga_checkable-icinga_checkable_flapping/host_flapping_docs_example
119/119 Test #119: icinga_checkable-icinga_checkable_flapping/host_flapping_docs_example ...   Passed    0.24 sec

99% tests passed, 1 tests failed out of 119

Total Test time (real) =  54.70 sec

The following tests FAILED:
     95 - base-icinga_legacytimeperiod/dst (Failed)
Errors while running CTest
make: *** [test] Error 8
➜  hotspare git:(e7c5554d8) git log -1
commit e7c5554d87e7a6c1175597f1ea97dfec943f7bf4 (HEAD, origin/pull/8969, origin/bugfix/perfdata-dont-get-parsed-correctly-8912)
Author: Yonas Habteab <yonas.habteab@icinga.com>
Date:   Fri Aug 13 10:18:08 2021 +0200

    Test: Add multiline PerfData test case
➜  hotspare git:(e7c5554d8)
julianbrost commented 1 year ago

My question was supposed to ask if anyone of you ever ran all tests natively on macOS (i.e. no Docker) since that test case was added? I.e. is it possible, that there was a change on the system that could affect this, like some recent update that could have changed DST stuff in the libc? I mean all that time period code heavily relies on mktime() and similar and I'm not 100% sure if every detail it relies on is well-defined or if there might be some implementation-defined behavior that might have changed.

Al2Klimov commented 1 year ago

Yes. And @yhabteab suspects a MacOS update.