Add reliable execution reporting and coordinated dashboard views
This commit is contained in:
@@ -35,6 +35,18 @@ class FaultTests(unittest.TestCase):
|
||||
self.assertTrue(records['mirror']['needs_reconciliation'])
|
||||
self.assertEqual(records['mirror']['delivery'],'uncertain_recovery')
|
||||
|
||||
def test_only_persistent_fault_escalates_after_recovery_window(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
c=SimpleNamespace(call=lambda *args:None);records={}
|
||||
with patch.object(faults,'Client',return_value=c),patch.object(c,'call') as call,patch.object(faults.time,'time',return_value=100):
|
||||
faults.report_process({'control':{}},Path(root),'mirror',SimpleNamespace(poll=lambda:2),records)
|
||||
self.assertEqual(call.call_args.args[1]['severity'],'warning')
|
||||
with patch.object(faults,'Client',return_value=c),patch.object(c,'call') as call,patch.object(faults.time,'time',return_value=221):
|
||||
faults.report_process({'control':{}},Path(root),'mirror',SimpleNamespace(poll=lambda:2),records)
|
||||
faults.report_process({'control':{}},Path(root),'mirror',SimpleNamespace(poll=lambda:2),records)
|
||||
self.assertEqual(call.call_count,1)
|
||||
self.assertEqual(call.call_args.args[0],'/api/hooks/escalate')
|
||||
|
||||
def test_hook_failure_remains_persistently_visible(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
c=SimpleNamespace(call=lambda *args:None)
|
||||
|
||||
Reference in New Issue
Block a user