diff --git a/seaweed-block/core/frontend/chunkstore/single_filer_test.go b/seaweed-block/core/frontend/chunkstore/single_filer_test.go index ab30c59a61..68ad3a0b30 100644 --- a/seaweed-block/core/frontend/chunkstore/single_filer_test.go +++ b/seaweed-block/core/frontend/chunkstore/single_filer_test.go @@ -4,6 +4,7 @@ import ( "context" "errors" "net" + "slices" "strings" "sync" "testing" @@ -289,8 +290,22 @@ func TestCheckSingleFilerNeedsEveryMasterToAnswer(t *testing.T) { f.masters = masters f.mu.Unlock() err := cl.CheckSingleFiler(context.Background()) - if !errors.Is(err, ErrNotSingleFiler) || !strings.Contains(err.Error(), "every master must answer") || !strings.Contains(err.Error(), "rerun when they answer") { - t.Errorf("%s (other first %v): %v; want a refusal naming the master that did not answer", c.name, otherFirst, err) + // It names the master that did not answer (its gRPC address, or + // the address as given when it does not parse) among those that + // did not answer in the last round (the bound may also cut the + // favourable master's last call). + want := bad + if g, gerr := grpcAddress(bad); gerr == nil { + want = g + } + const lead = "every master must answer, these did not: " + msg := "" + if err != nil { + msg = err.Error() + } + i, j := strings.Index(msg, lead), strings.Index(msg, " (rerun when they answer)") + if !errors.Is(err, ErrNotSingleFiler) || i < 0 || j < i || !slices.Contains(strings.Split(msg[i+len(lead):j], ", "), want) { + t.Errorf("%s (other first %v): %v; want a refusal naming %s among the masters that did not answer", c.name, otherFirst, err, want) } } }