From 7e0634205aa46fc54542cf1325a9045b4b31e673 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 9 Nov 2026 23:55:13 +0100 Subject: [PATCH] =?UTF-8?q?R2:=20a=20row=20holds=20the=20build=20seats'=20?= =?UTF-8?q?work=20queues=20above=20three=20deliveries=20and=20at=20most=20?= =?UTF-8?q?ten=20(ADR=200664=20=C2=A72,=20ADR=200436=20=C2=A76,=20issue=20?= =?UTF-8?q?1748=20review=202)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ --- .../internal/buscompose/buscompose_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/mesh-grants/internal/buscompose/buscompose_test.go b/modules/mesh-grants/internal/buscompose/buscompose_test.go index 39683774..157e7c9e 100644 --- a/modules/mesh-grants/internal/buscompose/buscompose_test.go +++ b/modules/mesh-grants/internal/buscompose/buscompose_test.go @@ -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/seats/meshvault" "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/catalogue" "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) } } + // 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", Uses: []Seat{{Name: "telegram-sender", Accepts: []string{"send"}}}}) if err != nil {