selfcompose test: wait for the pass's say that names the vault, never a fixed sleep (issue 774; design 47 H2) #255

Merged
mesh-tools merged 2 commits from fix/selfcompose-wants into main 2026-11-23 09:47:31 +00:00
Showing only changes of commit 2a6b92eeab - Show all commits
+5 -2
View File
@@ -562,7 +562,10 @@ func testTheNodeComposesItsWantsFromTheBus(t *testing.T) {
longMu.Lock()
long = append(long, line)
longMu.Unlock()
saidOnce.Do(func() { close(saidLong) })
// Only the line naming the slow read releases it: a tick before the read began says "nothing it reads".
if strings.Contains(line, "waits on the vault's own secrets") {
saidOnce.Do(func() { close(saidLong) })
}
}
}
// What fails is the vault's own, asked for keeper's secret through the same read.
@@ -604,7 +607,7 @@ func testTheNodeComposesItsWantsFromTheBus(t *testing.T) {
// vault's own secrets, which its slow read is.
if row.slow {
longMu.Lock()
names := len(long) > 0 && strings.Contains(long[0], "waits on the vault's own secrets")
names := slices.ContainsFunc(long, func(l string) bool { return strings.Contains(l, "waits on the vault's own secrets") })
longMu.Unlock()
if !names {
t.Errorf("%s: a pass that ran on said nothing of what it waits on: %q", name, long)