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)