An unplaced node owes no pass, so no timer is armed again; every wait a test sets is put back when it ends; pin mesh-sdk 8520a4c, whose masking splits only a file's secrets (issue 1126; review of seed-same-3, round 1)
mesh/delivery merged: source.main moved to novox/mesh-host@df878ba1f780
mesh/delivery-group group fix/1126-seed-same-3 merged: every member is merged
mesh/check pass 1e01868d92c3 on c3a2ffde6755 | carried from mesh-catalog 774fcdfa93ad | unit 2188 run, 1064 kept, 36 skipped | integration 2197 run, 1…

This commit is contained in:
2026-10-28 12:25:32 +01:00
parent 9d04ae7edd
commit 1e01868d92
4 changed files with 25 additions and 8 deletions
+21 -5
View File
@@ -244,7 +244,7 @@ func TestTheNodeComposesItsWantsFromTheBus(t *testing.T) {
// Issue 1126, the switch made safe: a bus not answering for a moment (a reload of its accounts) is tried again and
// refuses nothing; a pass whose run ended refuses nothing either.
composeAgain = []time.Duration{time.Millisecond, time.Millisecond, time.Millisecond}
setFor(t, &composeAgain, []time.Duration{time.Millisecond, time.Millisecond, time.Millisecond})
fresh := func(get func(context.Context, string, string) ([]byte, error)) (*Composer, *[]string) {
var refusals []string
e := b.env()
@@ -491,6 +491,14 @@ func TestTheNodeComposesItsWantsFromTheBus(t *testing.T) {
if composed != "" || !again.owed.Load() {
t.Errorf("%s: composed %v and owes a pass again %v; want nothing handed and a pass owed", row.name, composed != "", again.owed.Load())
}
// Then the catalogue no longer places the node: it composes nothing of its own, and owes no pass either, so
// no timer is armed again (rev-seed-same-3, round 1).
again.mu.Lock()
clear(again.placements)
again.mu.Unlock()
if again.compose(ctx); again.owed.Load() {
t.Errorf("%s: an unplaced node still owes a pass", row.name)
}
continue
}
if composed == "" {
@@ -837,7 +845,7 @@ func TestTheNodeComposesItsWantsFromTheBus(t *testing.T) {
t.Errorf("what runs moved, and %d answer(s) were composed again for %d group(s)", got-settled, len(answers))
}
// A read the bus did not answer is no answer to keep: the group is answered again after a bound, though nothing moved.
laterAgain = []time.Duration{20 * time.Millisecond}
setFor(t, &laterAgain, []time.Duration{20 * time.Millisecond})
ownFails.Store(true)
candidate("adds", 9, "lemurs", "keeper")
waitFor("the answer met the vault not answering", func(a map[string]delivery.CandidateAnswer) bool {
@@ -903,7 +911,7 @@ func TestTheNodeComposesItsWantsFromTheBus(t *testing.T) {
// Issue 1126, the shadow shows its work: one input not read after the wait is said, naming it, in the journal and in
// a refused answer to each group known; once read, the group is answered for real.
notReadyAfter = 30 * time.Millisecond
setFor(t, &notReadyAfter, 30*time.Millisecond)
nb := newPatternBus()
nenv := readOnly.env()
nenv.Watch = nb.watch
@@ -948,8 +956,7 @@ func TestTheNodeComposesItsWantsFromTheBus(t *testing.T) {
t.Errorf("a shadow not ready said %q", nsaid)
}
nmu.Unlock()
slowAfter = time.Nanosecond // every answer is slow: said, and noted in words that do not move with the time
defer func() { slowAfter = time.Minute }()
setFor(t, &slowAfter, time.Nanosecond) // every answer is slow: said, and noted in words that do not move with the time
nb.send(delivery.AssignerWantsBucket, agent.Update{Caught: true})
select {
case a := <-nanswered:
@@ -1310,3 +1317,12 @@ func TestAHaveSaysWhetherItsModuleRunsInsideTheNodesOwn(t *testing.T) {
})
}
}
// setFor sets a package global (a wait the composer or the shadow reads) for one test, and puts back what it held when
// the test ends, so no later test runs on another test's waits.
func setFor[T any](t *testing.T, p *T, v T) {
t.Helper()
old := *p
*p = v
t.Cleanup(func() { *p = old })
}