selfcompose: what is read decides the trunk build's stand: the running event's manifest held, a running composition's build read as ranOf reads it (A-480a, A-482)

Builds: design 47 G A-480a, A-482
This commit is contained in:
2026-11-17 23:58:13 +01:00
parent 121a8090b3
commit cdd8bd3cba
3 changed files with 43 additions and 28 deletions
+24 -13
View File
@@ -281,18 +281,20 @@ func runningModuleWithoutEntryStandsAsTheNewestBuild(t *testing.T) {
stopped bool // A-480a: heard stopped
trunk bool // A-480a: the catalog half's trunk build of the module has an entry (the newest build has none)
have string // A-482: the phase its have says, naming the build it runs ("" for none)
named bool // A-480a: its running event names a manifest
named string // A-480a: the manifest its running event names ("held": one this node holds, "unread": one it does not)
}{
{"runs, newest entry held", true, newest, true, true, old, false, false, "", false},
{"not running here", false, newest, true, false, old, false, false, "", false},
{"names no newer build", true, "", false, false, old, false, false, "", false},
{"newest entry not held", true, newest, false, false, old, false, false, "", false},
{"runs, no newest build, trunk entry held (A-480a)", true, "", false, true, old, false, true, "", false},
{"heard no running event, its have says running (A-480a, A-482)", false, "", false, true, old, false, true, "running", false},
{"heard no running event, its have says held (A-482)", false, "", false, true, old, false, true, "held", false},
{"wanted here, heard no running event, no have (A-482)", false, "", false, false, old, false, true, "", false},
{"its running event names a manifest (A-480a)", true, "", false, false, old, false, true, "", true},
{"heard stopped, trunk entry held (A-480a)", false, "", false, false, old, true, true, "running", false},
{"runs, newest entry held", true, newest, true, true, old, false, false, "", ""},
{"not running here", false, newest, true, false, old, false, false, "", ""},
{"names no newer build", true, "", false, false, old, false, false, "", ""},
{"newest entry not held", true, newest, false, false, old, false, false, "", ""},
{"runs, no newest build, trunk entry held (A-480a)", true, "", false, true, old, false, true, "", ""},
{"heard no running event, its have says running (A-480a, A-482)", false, "", false, true, old, false, true, "running", ""},
{"heard no running event, its have says held (A-482)", false, "", false, true, old, false, true, "held", ""},
{"wanted here, heard no running event, no have (A-482)", false, "", false, false, old, false, true, "", ""},
{"its running event names a manifest this node holds (A-480a)", true, "", false, false, old, false, true, "", "held"},
{"its running event names a manifest this node cannot read (A-480a)", true, "", false, true, old, false, true, "", "unread"},
{"runs a composition at another build, no manifest read (A-480a)", true, "", false, true, old, false, true, "other", ""},
{"heard stopped, trunk entry held (A-480a)", false, "", false, false, old, true, true, "running", ""},
} {
t.Run(tc.name, func(t *testing.T) {
env := newFakeBus().env()
@@ -311,12 +313,21 @@ func runningModuleWithoutEntryStandsAsTheNewestBuild(t *testing.T) {
if tc.runs {
c.heard = map[string]map[string]heardRun{"n1": {"postgres": {fingerprint: old}}}
}
if tc.named {
c.heard = map[string]map[string]heardRun{"n1": {"postgres": {fingerprint: old, manifest: "sha256:" + strings.Repeat("9", 64)}}}
if tc.named != "" {
digest := "sha256:" + strings.Repeat("9", 64)
c.heard = map[string]map[string]heardRun{"n1": {"postgres": {fingerprint: old, manifest: digest}}}
if tc.named == "held" {
c.manifests[digest] = []byte(body)
}
}
if tc.have != "" {
c.haveRuns["postgres"] = true
}
if tc.have == "other" {
c.env.Running = func() []compositions.Composed {
return []compositions.Composed{{Node: "n1", Module: "postgres", FP: meshcatalogclient.SourcePrefix2 + strings.Repeat("5", 64)}}
}
}
if tc.stopped {
c.heard = map[string]map[string]heardRun{"n1": {"postgres": {fingerprint: old, stopped: true}}}
}