R2: a row holds the build seats' work queues above three deliveries and at most ten (ADR 0664 §2, ADR 0436 §6, issue 1748 review 2)
Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
|||||||
"git.novox.be/novox/mesh-contracts/identity-and-access/go/clients/meshvaultclient"
|
"git.novox.be/novox/mesh-contracts/identity-and-access/go/clients/meshvaultclient"
|
||||||
"git.novox.be/novox/mesh-contracts/identity-and-access/go/seats/meshvault"
|
"git.novox.be/novox/mesh-contracts/identity-and-access/go/seats/meshvault"
|
||||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"
|
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"
|
||||||
|
"git.novox.be/novox/mesh-delivery/sdk/buildstep"
|
||||||
"git.novox.be/novox/mesh-sdk/go/announce"
|
"git.novox.be/novox/mesh-sdk/go/announce"
|
||||||
"git.novox.be/novox/mesh-sdk/go/catalogue"
|
"git.novox.be/novox/mesh-sdk/go/catalogue"
|
||||||
"github.com/nats-io/nats.go/jetstream"
|
"github.com/nats-io/nats.go/jetstream"
|
||||||
@@ -146,6 +147,20 @@ func TestTheCopiedComposerComposesAsTheControllers(t *testing.T) {
|
|||||||
t.Errorf("may publish %s: %v, want %v", subject, got, want)
|
t.Errorf("may publish %s: %v, want %v", subject, got, want)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// ADR 0664 §2 with ADR 0436 §6: the work queue offers a build seat's ask more often than the module runs it, so the stream
|
||||||
|
// never drops an ask before the module has ended it, and at most ten times.
|
||||||
|
for _, seat := range []string{"node-build-go", "node-build-node", "node-build-image"} {
|
||||||
|
held := Seat{Name: seat, Scope: "node", Accepts: []string{"delivery", "check", "recheck"}, PulledByKind: true}
|
||||||
|
_, workers := SeatTrafficObjects([]Principal{{Kind: KindModule, Node: "one", Module: "m-" + seat, Holds: []Seat{held}}})
|
||||||
|
if len(workers) == 0 {
|
||||||
|
t.Fatalf("%s: no worker composed", seat)
|
||||||
|
}
|
||||||
|
for _, w := range workers {
|
||||||
|
if w.MaxDeliver <= buildstep.AskRuns || w.MaxDeliver > 10 {
|
||||||
|
t.Errorf("%s worker %s offers an ask %d times, want more than %d runs and at most 10", seat, w.Name, w.MaxDeliver, buildstep.AskRuns)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
plain, err := PermissionsFor(Principal{Kind: KindModule, Node: "one", Module: "shop",
|
plain, err := PermissionsFor(Principal{Kind: KindModule, Node: "one", Module: "shop",
|
||||||
Uses: []Seat{{Name: "telegram-sender", Accepts: []string{"send"}}}})
|
Uses: []Seat{{Name: "telegram-sender", Accepts: []string{"send"}}}})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user