fix: [cherry-pick] Align minio object storage ut to new minio server behavior (#29015)

cherry-pick from master
pr: #29014
See also #29013

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2023-12-06 15:42:43 +08:00 committed by GitHub
parent 51614073ec
commit 2e82d65124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,19 +153,21 @@ func TestMinioObjectStorage(t *testing.T) {
key string
value []byte
}{
{false, "abc/", []byte("123")},
// {true, "abc/", []byte("123")}, will write as abc
{true, "abc/d", []byte("1234")},
{false, "abc/d/e", []byte("12345")},
{true, "abc/d/e", []byte("12345")},
{true, "abc/e/d", []byte("12354")},
{true, "key_/1/1", []byte("111")},
{true, "key_/1/2", []byte("222")},
{false, "key_/1/2/3", []byte("333")},
{true, "key_/1/2/3", []byte("333")},
{true, "key_/2/3", []byte("333")},
}
for _, test := range prepareTests {
err := testCM.PutObject(ctx, config.bucketName, test.key, bytes.NewReader(test.value), int64(len(test.value)))
require.Equal(t, test.valid, err == nil)
t.Run(test.key, func(t *testing.T) {
err := testCM.PutObject(ctx, config.bucketName, test.key, bytes.NewReader(test.value), int64(len(test.value)))
require.Equal(t, test.valid, err == nil)
})
}
insertWithPrefixTests := []struct {