2020-09-06 11:39:35 +00:00
|
|
|
package test
|
|
|
|
|
|
|
|
import (
|
2020-11-03 06:53:36 +00:00
|
|
|
"testing"
|
|
|
|
|
2021-04-22 06:45:57 +00:00
|
|
|
"github.com/milvus-io/milvus/internal/util/typeutil"
|
2020-09-06 11:39:35 +00:00
|
|
|
)
|
|
|
|
|
2020-11-04 09:58:43 +00:00
|
|
|
type UniqueID = typeutil.UniqueID
|
|
|
|
|
2020-09-06 11:39:35 +00:00
|
|
|
func TestKey2Seg(t *testing.T) {
|
2020-10-15 13:31:50 +00:00
|
|
|
// TODO: fix test
|
2020-11-11 01:54:01 +00:00
|
|
|
//return
|
2020-11-05 11:11:12 +00:00
|
|
|
//
|
|
|
|
//lookupUrl := "pulsar://localhost:6650"
|
|
|
|
//client, err := pulsar.NewClient(pulsar.ClientOptions{
|
|
|
|
// URL: lookupUrl,
|
|
|
|
//})
|
|
|
|
//if err != nil {
|
|
|
|
// log.Fatal(err)
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
//consumer, err := client.Subscribe(pulsar.ConsumerOptions{
|
|
|
|
// Topic: "Key2Seg",
|
|
|
|
// SubscriptionName: "sub-1",
|
|
|
|
//})
|
|
|
|
//
|
|
|
|
//obj := msgpb.Key2SegMsg{}
|
|
|
|
//msg, err := consumer.Receive(context.Background())
|
|
|
|
//proto.Unmarshal(msg.Payload(), &obj)
|
|
|
|
//assert.Equal(t, obj.Uid, UniqueID(0))
|
|
|
|
//consumer.Ack(msg)
|
|
|
|
//msg, err = consumer.Receive(context.Background())
|
|
|
|
//proto.Unmarshal(msg.Payload(), &obj)
|
|
|
|
//assert.Equal(t, obj.Uid, UniqueID(0))
|
|
|
|
//consumer.Ack(msg)
|
|
|
|
//consumer.Close()
|
|
|
|
//client.Close()
|
2020-09-06 11:39:35 +00:00
|
|
|
}
|