From 2a6b92eeab15f312cabf4f8d0263a419da2dbc5b Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 23 Nov 2026 10:46:02 +0100 Subject: [PATCH] selfcompose: only the say naming the vault read releases it Review round 1 of the slow vault read's wait: a tick before the read began says "waits on nothing it reads (composing)", which released the read at once; the read then ended before the next tick and the row failed again on a slow start. The read now waits for a line naming the vault's own secrets, and the row asks that any line said names it. Runs under issue 774 (a pass that runs on says what it waits on). Builds: design 47 H2 (test only; no design line changes) --- internal/selfcompose/selfcompose_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/selfcompose/selfcompose_test.go b/internal/selfcompose/selfcompose_test.go index c91fbc45..1928c99b 100644 --- a/internal/selfcompose/selfcompose_test.go +++ b/internal/selfcompose/selfcompose_test.go @@ -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)