milvus/internal/rootcoord/expire_cache_test.go
Jiquan Long 73463d030d
Fix dml stream leakage in Proxy (#19450)
Signed-off-by: longjiquan <jiquan.long@zilliz.com>

Signed-off-by: longjiquan <jiquan.long@zilliz.com>
2022-09-27 19:18:54 +08:00

22 lines
494 B
Go

package rootcoord
import (
"testing"
"github.com/milvus-io/milvus/api/commonpb"
"github.com/milvus-io/milvus/internal/proto/proxypb"
"github.com/stretchr/testify/assert"
)
func Test_expireCacheConfig_apply(t *testing.T) {
c := defaultExpireCacheConfig()
req := &proxypb.InvalidateCollMetaCacheRequest{}
c.apply(req)
assert.Nil(t, req.GetBase())
opt := expireCacheWithDropFlag()
opt(&c)
c.apply(req)
assert.Equal(t, commonpb.MsgType_DropCollection, req.GetBase().GetMsgType())
}