diff --git a/modules/mesh-delivery-checker/internal/check/try_test.go b/modules/mesh-delivery-checker/internal/check/try_test.go index 5c9522a4..fd9b26cd 100644 --- a/modules/mesh-delivery-checker/internal/check/try_test.go +++ b/modules/mesh-delivery-checker/internal/check/try_test.go @@ -193,7 +193,19 @@ func TestATryIsJudgedAsAGroupsCheckAndOwesTheForgeNothing(t *testing.T) { // ADR var waiting string cands.during = func() { waiting = readTry(t, kv, id).Waiting } // ADR 0639 ยง5: the stored try says what it waits for var said []string - tr := &Tryer{Tries: written, Judge: b.ex, Say: func(_ context.Context, event string, e checkermsg.Event) error { + var tr *Tryer + echoed := false + tr = &Tryer{Tries: written, Judge: b.ex, Say: func(ctx context.Context, event string, e checkermsg.Event) error { + if event == checkermsg.Ended && !echoed { + // The end the run wrote comes back on the key's watch while the run says it: Put stops the run's context and + // leaves the saying to the run, whose say must not be stopped with it (issue 1921). + echoed = true + raw, _, _, _ := kv.Get(context.Background(), id) + tr.Put(context.Background(), id, raw) + } + if err := ctx.Err(); err != nil { + return err // a publish on a stopped context is never acknowledged + } said = append(said, fmt.Sprintf("%s %s %d %s", event, e.ID, len(e.Members), e.State)) return nil }}