mirror of
https://github.com/pgsty/minio.git
synced 2026-10-06 17:55:59 +03:00
Enhance picking valid xlMeta based on quorum (#6297)
This PR borrows the idea from getFormatXLQuorum()
This commit is contained in:
committed by
kannappanr
parent
50dec08002
commit
3de5a3157f
@@ -19,7 +19,6 @@ package cmd
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"os"
|
||||
"path"
|
||||
"strconv"
|
||||
@@ -349,11 +348,11 @@ func TestPickValidXLMeta(t *testing.T) {
|
||||
metaArr: invalidXS,
|
||||
modTime: now,
|
||||
xlMeta: invalidX1,
|
||||
expectedErr: errors.New("No valid xl.json present"),
|
||||
expectedErr: errXLReadQuorum,
|
||||
},
|
||||
}
|
||||
for i, test := range testCases {
|
||||
xlMeta, err := pickValidXLMeta(context.Background(), test.metaArr, test.modTime)
|
||||
xlMeta, err := pickValidXLMeta(context.Background(), test.metaArr, test.modTime, len(test.metaArr)/2)
|
||||
if test.expectedErr != nil {
|
||||
if err.Error() != test.expectedErr.Error() {
|
||||
t.Errorf("Test %d: Expected to fail with %v but received %v",
|
||||
|
||||
Reference in New Issue
Block a user