@@ -111,7 +111,7 @@ def test_graceful_sigterm_exit_is_not_reported_as_forced_termination():
111111 assert pause ["forced_termination" ] is False
112112
113113
114- def test_expected_marker_sigterm_brackets_window_without_becoming_a_failed_oneoff ():
114+ def test_expected_marker_termination_brackets_window_without_becoming_a_failed_oneoff ():
115115 provenance_contract = {
116116 "operation" : "crawler-deploy" ,
117117 "issue" : 3409 ,
@@ -151,7 +151,7 @@ def test_expected_marker_sigterm_brackets_window_without_becoming_a_failed_oneof
151151 "container_generation" : "marker-generation" ,
152152 "compose_service" : "maintenance-window" ,
153153 "compose_oneoff" : "True" ,
154- "event_exit_code" : "143 " ,
154+ "event_exit_code" : "137 " ,
155155 "maintenance_provenance" : provenance_contract ,
156156 },
157157 ]
@@ -165,6 +165,105 @@ def test_expected_marker_sigterm_brackets_window_without_becoming_a_failed_oneof
165165 assert window ["service_pauses" ][0 ]["downtime_seconds" ] == 50.0
166166
167167
168+ def test_transient_unmonitored_service_does_not_stretch_a_maintenance_window ():
169+ provenance_contract = {
170+ "operation" : "crawler-deploy" ,
171+ "issue" : 3409 ,
172+ "revision" : "d" * 40 ,
173+ "budget_seconds" : 1800 ,
174+ }
175+ events = [
176+ {
177+ "source" : "docker_event" ,
178+ "event_at" : "2026-07-23T04:00:00+00:00" ,
179+ "action" : "die" ,
180+ "container_generation" : "old-init-generation" ,
181+ "compose_service" : "murmur-shim-runtime-init" ,
182+ "compose_oneoff" : "False" ,
183+ "event_exit_code" : "0" ,
184+ },
185+ {
186+ "source" : "docker_event" ,
187+ "event_at" : "2026-07-23T05:00:00+00:00" ,
188+ "action" : "start" ,
189+ "container_generation" : "marker-generation" ,
190+ "compose_service" : "maintenance-window" ,
191+ "compose_oneoff" : "True" ,
192+ "maintenance_provenance" : provenance_contract ,
193+ },
194+ {
195+ "source" : "docker_event" ,
196+ "event_at" : "2026-07-23T05:01:00+00:00" ,
197+ "action" : "die" ,
198+ "container_generation" : "marker-generation" ,
199+ "compose_service" : "maintenance-window" ,
200+ "compose_oneoff" : "True" ,
201+ "event_exit_code" : "137" ,
202+ "maintenance_provenance" : provenance_contract ,
203+ },
204+ {
205+ "source" : "docker_event" ,
206+ "event_at" : "2026-07-23T05:01:01+00:00" ,
207+ "action" : "start" ,
208+ "container_generation" : "new-init-generation" ,
209+ "compose_service" : "murmur-shim-runtime-init" ,
210+ "compose_oneoff" : "False" ,
211+ },
212+ {
213+ "source" : "docker_event" ,
214+ "event_at" : "2026-07-23T05:01:05+00:00" ,
215+ "action" : "die" ,
216+ "container_generation" : "new-init-generation" ,
217+ "compose_service" : "murmur-shim-runtime-init" ,
218+ "compose_oneoff" : "False" ,
219+ "event_exit_code" : "0" ,
220+ },
221+ ]
222+
223+ summary = provenance .correlate_events (events )
224+
225+ assert summary ["unattributed_service_pauses" ] == []
226+ window = summary ["maintenance_windows" ][0 ]
227+ assert window ["duration_seconds" ] == 60.0
228+ assert window ["service_pauses" ] == []
229+ assert window ["status" ] == "completed"
230+
231+
232+ def test_marker_oom_remains_actionable ():
233+ provenance_contract = {
234+ "operation" : "crawler-deploy" ,
235+ "issue" : 3409 ,
236+ "revision" : "d" * 40 ,
237+ "budget_seconds" : 1800 ,
238+ }
239+ events = [
240+ {
241+ "source" : "docker_event" ,
242+ "event_at" : "2026-07-23T05:00:00+00:00" ,
243+ "action" : "start" ,
244+ "container_generation" : "marker-generation" ,
245+ "compose_service" : "maintenance-window" ,
246+ "compose_oneoff" : "True" ,
247+ "maintenance_provenance" : provenance_contract ,
248+ },
249+ {
250+ "source" : "docker_event" ,
251+ "event_at" : "2026-07-23T05:00:10+00:00" ,
252+ "action" : "oom" ,
253+ "container_generation" : "marker-generation" ,
254+ "compose_service" : "maintenance-window" ,
255+ "compose_oneoff" : "True" ,
256+ "state" : {"oom_killed" : True },
257+ "maintenance_provenance" : provenance_contract ,
258+ },
259+ ]
260+
261+ window = provenance .correlate_events (events )["maintenance_windows" ][0 ]
262+
263+ assert window ["status" ] == "actionable"
264+ assert window ["actionable_reasons" ] == ["oom" ]
265+
266+
168267def test_missing_service_restoration_remains_actionable ():
169268 events = [
170269 event
0 commit comments