H1 integration bound: the runner follows a membership without dropping a call

On every membership of a module, HandleCalled stopped each subscription
of a tool and subscribed again on the same subjects; a call the bus
routed in that window was dropped by the client in silence, and its
caller waited the runner's whole bound (30 s). On the build node this
was the 30 s of TestAReplacedBundlesOldToolStaysGoneOnTheNextMembership
and of TestTheLedgerRepairsAreToolsOfEveryLedgerOwner, and most of the
integration level's 72 s. Now a membership keeps every subscription whose
subject and queue it still names, subscribes the new ones, and only then
stops those it no longer names (make before break).

The test asks the served tool once after each of five memberships, with
the tests' own call bound of 2 s (principle 11); it fails without the
change. The runtime tests' call helper and the ledger listing wait that
bound, not the runner's 30 s.

Builds: design 47 H §774, H-A-158; principle 11
This commit is contained in:
2026-11-20 17:18:09 +01:00
parent b1d10dd67e
commit eb174d853f
4 changed files with 35 additions and 14 deletions
+10 -3
View File
@@ -263,7 +263,9 @@ func TestAReplacedBundleIsReloaded(t *testing.T) {
// A replaced bundle's old tool stays gone when the module's membership is issued again: a stopped tool
// leaves no membership handler behind to bind it once more, and a call on it starts no unmanaged second
// copy of the bundle (issue 1945, review round 2).
// copy of the bundle (issue 1945, review round 2). And the tool still served answers the first call asked
// after each membership, within the test's own bound: the runner keeps the subscriptions the membership
// still names, so no call is dropped while it follows one (design 47 H, H-A-158).
func TestAReplacedBundlesOldToolStaysGoneOnTheNextMembership(t *testing.T) {
b := newReloadBed(t)
place(t, b.entry, "first")
@@ -273,8 +275,13 @@ func TestAReplacedBundlesOldToolStaysGoneOnTheNextMembership(t *testing.T) {
b.answers(t, "second")
b.silent(t, "first")
b.mesh.Issue(t, mt.MembershipOf("ledger", "anchor", false, nil))
b.answers(t, "second")
for round := 1; round <= 5; round++ {
b.mesh.Issue(t, mt.MembershipOf("ledger", "anchor", false, nil))
if got, err := call(t, b.asker, "ledger.second@anchor", map[string]any{}); err != nil || !strings.Contains(got, `"tool":"second"`) {
t.Fatalf("membership %d issued again: the first call of ledger.second answered %s, %v — dropped while the runner "+
"followed the membership\n%s", round, got, err, b.logs.All())
}
}
// Long enough for the reissued membership to have been heard, before the old tool is asked.
time.Sleep(300 * time.Millisecond)
if got, err := call(t, b.asker, "ledger.first@anchor", map[string]any{}); err == nil {