Fix TestMetaCache_ExpireShardLeaderCache unit test (#22651)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/22657/head
congqixia 2023-03-09 18:25:52 +08:00 committed by GitHub
parent a96344b3d0
commit d9908ff231
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -834,7 +834,7 @@ func TestMetaCache_ExpireShardLeaderCache(t *testing.T) {
assert.Eventually(t, func() bool {
nodeInfos, err := globalMetaCache.GetShards(ctx, true, "collection1")
assert.NoError(t, err)
return assert.Len(t, nodeInfos["channel-1"], 2)
return len(nodeInfos["channel-1"]) == 2
}, 3*time.Second, 1*time.Second)
queryCoord.EXPECT().GetShardLeaders(mock.Anything, mock.Anything).Return(&querypb.GetShardLeadersResponse{
@ -877,6 +877,6 @@ func TestMetaCache_ExpireShardLeaderCache(t *testing.T) {
assert.Eventually(t, func() bool {
nodeInfos, err := globalMetaCache.GetShards(ctx, true, "collection1")
assert.NoError(t, err)
return assert.Len(t, nodeInfos["channel-1"], 3) && assert.Len(t, nodeInfos["channel-2"], 3)
return len(nodeInfos["channel-1"]) == 3 && len(nodeInfos["channel-2"]) == 3
}, 3*time.Second, 1*time.Second)
}