From 4604b308914beeba0b917018df7910ccb68364de Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sun, 29 Nov 2026 13:24:05 -0800 Subject: [PATCH] test(chunkstore): the census test checks the unanswered master it names TestCheckSingleFilerNeedsEveryMasterToAnswer now requires the refusal to name the master that did not answer, by its gRPC address or as given when it does not parse, among those named for the last round. The bound may also cut the favourable master's last call, so that master can be named too. Dropping a master from the named list fails every case it covers. Co-Authored-By: Claude Opus 5.5 --- .../frontend/chunkstore/single_filer_test.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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) } } }