The node-engine reads each assignment by the build its node keeps and says a seat pass in its answer (issue 1966, ADR 0660)
Claude-Session: https://claude.ai/code/session_01NcbgfFfQ4Z9UE5jK32PmE5
This commit is contained in:
@@ -183,7 +183,7 @@ func TestNoSeatIsPassedForTwoClaimantsAnAssignedHolderOrNoClaimant(t *testing.T)
|
||||
// seat_pass_test.go TestAHolderAssignedButNotOnTheShelfIsNotTakenForGone.
|
||||
func TestAHolderAssignedButNotOnTheShelfIsNotTakenForGone(t *testing.T) {
|
||||
withSeat(t)
|
||||
as := assignmentsOf(map[string]catalogue.Manifest{"gate": aBrokerClaiming("gate")},
|
||||
as := (&composer{}).assignmentsOf(map[string]catalogue.Manifest{"gate": aBrokerClaiming("gate")},
|
||||
map[string][]string{"novox": {"gate", "old-broker"}})
|
||||
passes, _ := catalogue.SeatsToPassOn(
|
||||
[]catalogue.Held{{Claim: "mesh-broker", Scope: catalogue.ScopeMesh, Node: "novox", Module: "old-broker"}}, as)
|
||||
@@ -264,4 +264,18 @@ func TestAHolderWhoseManifestDroppedTheSeatGoesToItsOnlyClaimant(t *testing.T) {
|
||||
!strings.Contains(said, "seat mesh-broker --to <node>/<module>") {
|
||||
t.Fatalf("two claimants: %v %+v", err, passes)
|
||||
}
|
||||
// The build the holder's node runs still claims the seat, though the trunk dropped it: the holder keeps it (ADR 0660 §2).
|
||||
running := mk("gate")
|
||||
running.Nodes[0].Kept = map[string]catalogue.Manifest{"old-broker": aBrokerClaiming("old-broker")}
|
||||
_, passes, _, err = TheRestOfTheMesh(running, "")
|
||||
if err != nil || len(passes.Passes) != 0 || len(passes.Said) != 0 {
|
||||
t.Fatalf("a holder whose running build claims the seat lost it: %v %+v", err, passes)
|
||||
}
|
||||
// And a pass is said in the composition's answer, not recorded.
|
||||
var d Declared
|
||||
d, _, err = Compose(mk("gate"), "novox")
|
||||
said = strings.Join(d.Said, "\n")
|
||||
if err != nil || !strings.Contains(said, "mesh-broker: old-broker on novox") || !strings.Contains(said, "held by gate on novox, not recorded") {
|
||||
t.Fatalf("the answer does not say the pass: %v %q", err, said)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user