From d9908ff2317b11d7fb6f2a5458ee3c2ad0347d66 Mon Sep 17 00:00:00 2001 From: congqixia Date: Thu, 9 Mar 2023 18:25:52 +0800 Subject: [PATCH] Fix TestMetaCache_ExpireShardLeaderCache unit test (#22651) Signed-off-by: Congqi Xia --- internal/proxy/meta_cache_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/proxy/meta_cache_test.go b/internal/proxy/meta_cache_test.go index ee6a563e26..e837398c25 100644 --- a/internal/proxy/meta_cache_test.go +++ b/internal/proxy/meta_cache_test.go @@ -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) }