File tree Expand file tree Collapse file tree
tests/unit/cmk/plugins/oracle/agent_based Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,6 +90,29 @@ def test_check_oracle_instance_uptime_error() -> None:
9090 )
9191
9292
93+ @pytest .mark .xfail (strict = True , reason = "Crash group 3653: ValueError on negative up_seconds" )
94+ def test_check_oracle_instance_uptime_negative_uptime () -> None :
95+ """Negative up_seconds from Oracle causes ValueError in render.timespan."""
96+ with time_machine .travel (datetime .datetime .fromtimestamp (1643360266 , tz = ZoneInfo ("UTC" ))):
97+ results = list (
98+ check_plugin_oracle_instance_uptime .check_function (
99+ item = "OBIP" ,
100+ params = {},
101+ section = {
102+ "OBIP" : Instance (
103+ sid = "OBIP" ,
104+ version = "203.0.0.1.0" ,
105+ openmode = "OPEN" ,
106+ logins = "ALLOWED" ,
107+ up_seconds = - 6689 ,
108+ ),
109+ },
110+ )
111+ )
112+ # Should not crash — negative uptime is an anomaly but should be handled gracefully
113+ assert any (isinstance (r , Result ) for r in results )
114+
115+
93116def test_check_oracle_instance_uptime_pdb_mounted () -> None :
94117 with time_machine .travel (datetime .datetime .fromtimestamp (1643360266 , tz = ZoneInfo ("UTC" ))):
95118 assert list (
You can’t perform that action at this time.
0 commit comments