I9 dropped-subjects-acked: TestIndexerWhole reads that the events of the dropped subjects raise no finding event-unhandled

Builds: design 47 H2 H-A-578 (2), H-A-651 (AC-I9; review round 1)
This commit is contained in:
2026-11-25 18:51:49 +01:00
parent 419bf9734a
commit c7b137863e
@@ -432,6 +432,10 @@ func TestIndexerWhole(t *testing.T) {
t.Fatal(err)
}
}
// The indexer's findings, which the grants part makes from its manifest's state findings (AC-I9 reads them).
if _, err = js.CreateKeyValue(ctx, jetstream.KeyValueConfig{Bucket: findingsBucket, History: 1}); err != nil {
t.Fatal(err)
}
regs = registerAvahi(t, ctx, js, "main", "beta")
tc, err := js.CreateKeyValue(ctx, jetstream.KeyValueConfig{Bucket: index.ToolchainsBucket("mesh-build-go"), History: 1})
if err != nil {
@@ -452,13 +456,17 @@ func TestIndexerWhole(t *testing.T) {
// Design 47 H2 H-A-578 (2), H-A-651 (AC-I9): an event of a subject the manifest no longer consumes, which the durable's
// filter still holds, is acknowledged with no work (the unit test of ackDropped holds that it says the subject once).
// Two rounds: the hub hands one message at a time and says an unhandled one's finding after its acknowledgement, so the
// second round's acknowledgements come after the first round's findings were written, if any.
var last uint64
for _, subject := range droppedSubjects {
ack, err := js.Publish(ctx, subject, []byte(`{}`))
if err != nil {
t.Fatal(err)
for range 2 {
for _, subject := range droppedSubjects {
ack, err := js.Publish(ctx, subject, []byte(`{}`))
if err != nil {
t.Fatal(err)
}
last = ack.Sequence
}
last = ack.Sequence
}
cons, err := testAccount.EventConsumer(ctx, js, views0Stream)
if err != nil {
@@ -476,6 +484,17 @@ func TestIndexerWhole(t *testing.T) {
t.Fatalf("the dropped subjects events are not acknowledged: ack floor %d, want %d", info.AckFloor.Stream, last)
}
}
// AC-I9: the hub says no finding event-unhandled of them, since the subjects have a handler (without it the hub
// acknowledges them just the same, so the acknowledgement above does not hold it).
findings, err := js.KeyValue(ctx, findingsBucket)
if err != nil {
t.Fatal(err)
}
if e, err := findings.Get(ctx, views.FindingKey(views.FindingScope, keys.EscapeName(testIndexer), views.EventUnhandledKind)); err == nil {
t.Errorf("the dropped subjects' events raised the finding %s: %s", e.Key(), e.Value())
} else if !errors.Is(err, jetstream.ErrKeyNotFound) {
t.Fatal(err)
}
// The first revision: no mover, no pin; its entries are the base.
sayMoved(t, ctx, js, "main", 10, c10, true)
// A revision's number is the indexer's own count, the branch's newest + 1 (design 47 H-A-213 (1)): the later take-ins of