diff --git a/modules/mesh-knowledge/cmd/mesh-knowledge/review_test.go b/modules/mesh-knowledge/cmd/mesh-knowledge/review_test.go index caea95c34..ac8379afb 100644 --- a/modules/mesh-knowledge/cmd/mesh-knowledge/review_test.go +++ b/modules/mesh-knowledge/cmd/mesh-knowledge/review_test.go @@ -2,6 +2,7 @@ package main import ( "context" + "fmt" "strings" "testing" "time" @@ -283,6 +284,12 @@ func TestARecordThatNeedsTheOperatorIsAcceptedOnlyOnTheWarrant(t *testing.T) { if last := vs[len(vs)-1]; !strings.Contains(last.Why, "warrant") || last.By != "the operator" { t.Fatalf("the accepting version: %+v", last) } + // Issue 595: a session waiting on the Approve wakes on this event (node-tools' `waits` names it); it says who + // accepted and on which warrant. + if got := w.said.of(EventAccepted); len(got) != 1 || got[0]["by"] != "the operator" || got[0]["record"] != itoaKey(n) || + !strings.Contains(fmt.Sprint(got[0]["what"]), "warrant") { + t.Fatalf("the accepted event: %v", got) + } if said, _ := w.k.Reconcile(); len(said) != 0 { t.Fatalf("decided twice: %v", said) }