I9 dropped-subjects-acked: TestIndexerWhole acknowledges an event of each dropped subject on the durable's filter
The bed's stream and durable filter hold the two dropped subjects; the whole test publishes one of each and waits for the consumer's ack floor to pass them. Builds: design 47 H2 H-A-578 (2), H-A-651, H-A-706
This commit is contained in:
@@ -396,7 +396,8 @@ func startIndexerRun(t *testing.T, put func(context.Context, buildLog), before .
|
||||
"mesh.seat.mesh-catalog.event.full", "mesh.seat.mesh-catalog.event.room", "mesh.seat.mesh-catalog.event.seat-definition-changed",
|
||||
"mesh.seat.mesh-catalog.event.seat-definition-removed", "mesh.seat.mesh-catalog.event.manifest-accepted", "mesh.seat.mesh-catalog.event.version-released",
|
||||
"mesh.seat.mesh-conditions.event.>", "mesh.seat.operator-channel.event.>", "mesh.seat.go-package-registry.event.>", "mesh.seat.npm-package-registry.event.>",
|
||||
"mesh.seat.mesh-module-assigner.event.>", "mesh.seat.node-build-go.event.>", meshbuilds.SubjectVersionReserved}}); err != nil { // not the seats kept in streams of their own (wanted and running, above)
|
||||
"mesh.seat.mesh-module-assigner.event.>", "mesh.seat.node-build-go.event.>", meshbuilds.SubjectVersionReserved,
|
||||
droppedSubjects[0], droppedSubjects[1]}}); err != nil { // not the seats kept in streams of their own (wanted and running, above)
|
||||
t.Fatal(err)
|
||||
}
|
||||
// The indexer's durable on the shared events stream (process.EventHub), which carries its own room (design 47 H §744, H-A-50).
|
||||
@@ -803,7 +804,7 @@ func serveAssignerAssignments(t *testing.T, ctx context.Context, js jetstream.Je
|
||||
// builder's version-reserved, which no stream of its own keeps (design 47 H2 §805), and the Go package registry seat's
|
||||
// published, a series' newest a pin names (H-A-495 addendum), and the Go build seat's imports-reported (design 47 H2 H-A-517).
|
||||
FilterSubjects: []string{"mesh.mod." + assignerHolderModule + ".event.views.>", meshcatalog.SubjectRoom, nodebuildgo.SubjectStepEndedAll, meshbuilds.SubjectVersionReserved,
|
||||
gopackageregistry.SubjectPublished, nodebuildgo.SubjectImportsReportedAll}}); err != nil {
|
||||
gopackageregistry.SubjectPublished, nodebuildgo.SubjectImportsReportedAll, droppedSubjects[0], droppedSubjects[1]}}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
em := views.Emitter{Owner: assignerHolderModule, Subject: process.Account{Node: "n1", Module: assignerHolderModule}.EventSubject,
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -448,6 +449,32 @@ func TestIndexerWhole(t *testing.T) {
|
||||
}
|
||||
objects := newBusObjects(js, testAccount, index.CatalogRevisionsObjects)
|
||||
|
||||
// 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).
|
||||
var last uint64
|
||||
for _, subject := range droppedSubjects {
|
||||
ack, err := js.Publish(ctx, subject, []byte(`{}`))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
last = ack.Sequence
|
||||
}
|
||||
cons, err := testAccount.EventConsumer(ctx, js, views0Stream)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for deadline := time.Now().Add(waitBound); ; runtime.Gosched() {
|
||||
info, err := cons.Info(ctx)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if info.AckFloor.Stream >= last {
|
||||
break
|
||||
}
|
||||
if time.Now().After(deadline) {
|
||||
t.Fatalf("the dropped subjects events are not acknowledged: ack floor %d, want %d", info.AckFloor.Stream, last)
|
||||
}
|
||||
}
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user