mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-06 02:57:37 +01:00
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
9e4e1ade67
commit
ab6b1598b9
1 file changed
+3
-2
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user