fix: [skip-e2e] TestAvgReassignPolicy ut (#32450)

See also: #32448

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
This commit is contained in:
XuanYang-cn 2024-04-19 15:11:20 +08:00 committed by GitHub
parent 01c16fe6e3
commit 7e830f6185
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,6 +22,7 @@ import (
"github.com/samber/lo"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
memkv "github.com/milvus-io/milvus/internal/kv/mem"
)
@ -409,7 +410,15 @@ func TestAvgReassignPolicy(t *testing.T) {
}
t.Run(tt.name, func(t *testing.T) {
got := AverageReassignPolicy(tt.args.store, tt.args.reassigns)
assert.ElementsMatch(t, tt.want.Collect(), got.Collect())
wantMap, gotMap := tt.want.SplitByChannel(), got.SplitByChannel()
assert.ElementsMatch(t, lo.Keys(wantMap), lo.Keys(gotMap))
for k, opSet := range wantMap {
gotOpSet, ok := gotMap[k]
require.True(t, ok)
assert.ElementsMatch(t, opSet.Collect(), gotOpSet.Collect())
}
})
}
}