From ab6b1598b97593a3f984145d0f86d4937cdbed72 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 2 Dec 2026 03:15:58 -0800 Subject: [PATCH] mq/offset: fix a flaky partial-listing test (#13288) mq/offset: fail the test lookup the way a filer store does TestListConsumerGroupPositionsReturnsWhatItReadOnAFailure flaked (about 1 in 60 runs): its fake filer failed the unreadable position with codes.Unavailable and no details, which pb treats as a dead channel. The shared ClientConn was closed and the concurrent loads of the other partitions failed with it, so the listing returned one position, not two. A real filer answers a store read error with a plain error (codes.Unknown), which keeps the channel. The fake now does the same. Co-authored-by: Claude Opus 5.5 --- weed/mq/offset/consumer_group_fence_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/weed/mq/offset/consumer_group_fence_test.go b/weed/mq/offset/consumer_group_fence_test.go index fbbef36fec..689f3fea42 100644 --- a/weed/mq/offset/consumer_group_fence_test.go +++ b/weed/mq/offset/consumer_group_fence_test.go @@ -32,7 +32,8 @@ type conditionalFiler struct { beforeWrite func() // looked counts the lookups of each path looked map[string]int - // failLookups fails the lookups of these paths, as a filer that cannot read them + // failLookups fails the lookups of these paths the way a filer whose store + // cannot read them does failLookups map[string]bool } @@ -44,7 +45,7 @@ func (f *conditionalFiler) LookupDirectoryEntry(ctx context.Context, req *filer_ } f.looked[req.Directory+"/"+req.Name]++ if f.failLookups[req.Directory+"/"+req.Name] { - return nil, status.Error(codes.Unavailable, "store unavailable") + return nil, errors.New("store unavailable") } entry, ok := f.entries[req.Directory+"/"+req.Name] if !ok {