H2b-review-4 events-unheard-names-each: the finding events-unheard names every pattern not heard, no bound
Builds: design 47 H2b §836 4. (review round 1, part 1, item 4)
This commit is contained in:
@@ -158,15 +158,11 @@ func overrunFinding(module string, past []process.Handling, at time.Time) viewFi
|
||||
}
|
||||
|
||||
// unheardFinding is the module's one finding of the patterns its hub does not hear (design 47 H2b §836 4.): its id `<module>.<node>`,
|
||||
// its summary each pattern with its stream and why, at most five and then how many more, and the way through: the node's service
|
||||
// its summary each pattern with its stream and why, every one named (no bound), and the way through: the node's service
|
||||
// manager restarts the module's unit.
|
||||
func unheardFinding(module, node string, list []process.Unheard, at time.Time) viewFinding {
|
||||
var named []string
|
||||
for i, u := range list {
|
||||
if i == overrunMost {
|
||||
named = append(named, fmt.Sprintf("and %d more", len(list)-overrunMost))
|
||||
break
|
||||
}
|
||||
for _, u := range list {
|
||||
if u.Stream == "" {
|
||||
named = append(named, fmt.Sprintf("%s (%s)", u.Pattern, u.Why))
|
||||
continue
|
||||
|
||||
@@ -1591,6 +1591,14 @@ func TestTheOverrunFindingNamesTheHandlingsOldestFirst(t *testing.T) {
|
||||
!strings.Contains(f.summary, "mesh.seat.s.event.e.> on SEAT_s_e (not composed)") || !strings.Contains(f.summary, "mesh.mod.p.event.x (no stream carries it)") {
|
||||
t.Errorf("the finding: %+v", f)
|
||||
}
|
||||
// §836 4.: each pattern not heard is named, however many
|
||||
var many []process.Unheard
|
||||
for i := range 8 {
|
||||
many = append(many, process.Unheard{Pattern: fmt.Sprintf("mesh.mod.p.event.x%d", i), Why: "no stream carries it"})
|
||||
}
|
||||
if f := unheardFinding("builder", "n1", many, at); !strings.Contains(f.summary, "mesh.mod.p.event.x7 (no stream carries it)") || strings.Contains(f.summary, "more") || !strings.Contains(f.summary, "does not hear 8 event patterns") {
|
||||
t.Errorf("eight patterns not heard were not all named: %s", f.summary)
|
||||
}
|
||||
fm := &findingsMap{}
|
||||
pr := &ProcessReader{Module: "m", Findings: func() WireWriter { return fm }, Now: func() time.Time { return at }}
|
||||
pr.unheardPatterns(list)
|
||||
|
||||
Reference in New Issue
Block a user