Compose: an artifact store with no known address holds the modules that fetch from it, not the node (A-461, second part)

Builds: design 47 G A-461 (second sentence; the first, laying another node's module from its want's entry, waits on a lead answer)
This commit is contained in:
2026-11-17 01:10:49 +01:00
parent 523ad97e28
commit b132653fc0
3 changed files with 56 additions and 3 deletions
+16 -2
View File
@@ -351,8 +351,22 @@ func TestTheStoreIsFoundByTheImageSeatsHolderAndItsListen(t *testing.T) {
m := in.Catalogue["registry"]
m.Listens = append(m.Listens, catalogue.Listening{Name: "other", Port: 5300, From: catalogue.FromMesh})
in.Catalogue["registry"] = m
if _, err := Places(in, "laptop"); err == nil || !strings.Contains(err.Error(), "opens registry (5000), other (5300) to the mesh") {
t.Errorf("a holder opening two listens to the mesh: %v", err)
// A-461: a store with no known address (two listens open to the mesh, so none is a guess) costs the modules that fetch from
// it, not the node: those wait with the words of an unanswered requirement, and the node composes the rest.
in.Catalogue["app"] = catalogue.Manifest{Module: "app", Version: "1",
Resources: []map[string]any{{"id": "c", "type": "container", "name": "app", "image": "artifact-store://app/c@sha256:" + strings.Repeat("a", 64)}}}
in.Catalogue["plain"] = catalogue.Manifest{Module: "plain", Version: "1"}
laptop := nodeOf(t, &in, "laptop")
laptop.Assigned = append(laptop.Assigned, "app", "plain")
got, err := Render(in, "laptop", Reading)
if err != nil {
t.Fatalf("a holder opening two listens to the mesh refuses the whole node: %v", err)
}
if why := got.Rendering.NotPlaced["app"]; !strings.Contains(why, "nothing provides") || !strings.Contains(why, "opens registry (5000), other (5300) to the mesh") {
t.Errorf("the module that fetches from the store waits with %q", why)
}
if why, held := got.Rendering.NotPlaced["plain"]; held {
t.Errorf("a module that fetches nothing from the store waits: %q", why)
}
}