views: count the events no handler takes as the module's finding
An event a module consumes that no handler takes was said in the journal alone, so a part that never acted on it (the runner's placing at 17:34) was seen only by reading the log. The event hub now tells a hook of each such subject; the process reader, where it holds a findings writer, counts them in one finding event-unhandled per module (the count since the start and the last subject) and clears it at its start, since a new build may handle the event. Without a findings writer the journal line stands alone. Builds: design 47 H H-A-166, H-A-169
This commit is contained in:
@@ -37,6 +37,15 @@ func TestTheHubMatchesSubjectsAndRefusesOverlappingPatterns(t *testing.T) {
|
||||
if err := h.Handle("mesh.mod.q.event.>", nop); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// H-A-169: a message no handler takes is acknowledged and told to each OnUnhandled hook, with its subject; one taken is not.
|
||||
var told []string
|
||||
h.OnUnhandled(func(subject string) { told = append(told, subject) })
|
||||
taken, lost := &bindMsg{subject: "mesh.mod.q.event.x"}, &bindMsg{subject: "mesh.seat.s.event.nobody"}
|
||||
h.hear(taken)
|
||||
h.hear(lost)
|
||||
if !lost.acked || len(told) != 1 || told[0] != "mesh.seat.s.event.nobody" {
|
||||
t.Errorf("the unhandled message: acked %v, told %v", lost.acked, told)
|
||||
}
|
||||
// W1.12: a seat's event kept in a stream of its own is heard on one bus name and one durable, the maker's and the
|
||||
// hearer's alike; an event kept last per subject is delivered from the last of each subject. The name is the
|
||||
// contract's Stream<E> as it stands (seatdef.KeptStream), never made again here: a dotted or unprefixed name is
|
||||
|
||||
Reference in New Issue
Block a user