feat(watchdog): quarantine escalates to ask_owner; reinstate/retire resolve fail-safe (#45)

This commit is contained in:
Smokey committed 2026-10-28 09:20:34 -06:00
1 parent bf4844c010
commit 720352c45b
6 files changed
+207 -23

No files matched your search

+9 -2
View File
@@ -186,7 +186,7 @@ func TestAskOwnerTimeoutKeepsQuarantine(t *testing.T) {
id, req, ask := breachToAsk(t, ts)
askID := ask["msg_id"].(string)
s.askTimeout = time.Millisecond
s.askTimeout.Store(int64(time.Millisecond))
time.Sleep(25 * time.Millisecond)
if r := askResolved(t, ts, id, askID); r != "rejected" {
@@ -200,7 +200,14 @@ func TestAskOwnerTimeoutKeepsQuarantine(t *testing.T) {
if code != http.StatusForbidden {
t.Fatalf("a timed-out ask keeps the crow silenced: claim must get 403, got %d %v", code, out)
}
if f := findFlag(ts, id, ask["refers_to"].(string)); f == nil {
flagID := ask["refers_to"].(string)
flagSeen := false
for _, m := range nestMessages(t, ts, id) {
if m["kind"] == "flag" && m["msg_id"] == flagID {
flagSeen = true
}
}
if !flagSeen {
t.Fatal("the flag must still be in the log")
}
if rec := watchRecord(t, s); rec != nil {