Decrease unittests execution time in query node (#7791)

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
pull/7804/head
bigsheeper 2021-09-13 16:37:01 +08:00 committed by GitHub
parent 9ccc9d2349
commit 73ab06c628
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 43 deletions

View File

@ -111,21 +111,19 @@ func TestIndexLoader_loadIndex(t *testing.T) {
assert.Error(t, err)
})
if runTimeConsumingTest {
t.Run("test get index failed", func(t *testing.T) {
historical, err := genSimpleHistorical(ctx)
assert.NoError(t, err)
segment, err := genSimpleSealedSegment()
assert.NoError(t, err)
historical.loader.indexLoader.rootCoord = newMockRootCoord()
historical.loader.indexLoader.indexCoord = newMockIndexCoord()
err = historical.loader.indexLoader.loadIndex(segment, rowIDFieldID)
assert.Error(t, err)
})
}
//t.Run("test get index failed", func(t *testing.T) {
// historical, err := genSimpleHistorical(ctx)
// assert.NoError(t, err)
//
// segment, err := genSimpleSealedSegment()
// assert.NoError(t, err)
//
// historical.loader.indexLoader.rootCoord = newMockRootCoord()
// historical.loader.indexLoader.indexCoord = newMockIndexCoord()
//
// err = historical.loader.indexLoader.loadIndex(segment, rowIDFieldID)
// assert.Error(t, err)
//})
t.Run("test checkIndexReady failed", func(t *testing.T) {
historical, err := genSimpleHistorical(ctx)

View File

@ -42,7 +42,6 @@ import (
// common definitions
const ctxTimeInMillisecond = 5000
const debug = false
const runTimeConsumingTest = true
const (
dimKey = "dim"

View File

@ -17,7 +17,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/internal/msgstream"
"github.com/milvus-io/milvus/internal/proto/commonpb"
"github.com/milvus-io/milvus/internal/proto/datapb"
"github.com/milvus-io/milvus/internal/proto/querypb"
@ -99,32 +98,30 @@ func TestTask_watchDmChannelsTask(t *testing.T) {
assert.NoError(t, err)
})
if runTimeConsumingTest {
t.Run("test execute seek error", func(t *testing.T) {
node, err := genSimpleQueryNode(ctx)
assert.NoError(t, err)
task := watchDmChannelsTask{
req: genWatchDMChannelsRequest(),
node: node,
}
task.req.Infos = []*datapb.VchannelInfo{
{
CollectionID: defaultCollectionID,
ChannelName: defaultVChannel,
SeekPosition: &msgstream.MsgPosition{
ChannelName: defaultVChannel,
MsgID: []byte{1, 2, 3},
MsgGroup: defaultSubName,
Timestamp: 0,
},
},
}
err = task.Execute(ctx)
assert.Error(t, err)
})
}
//t.Run("test execute seek error", func(t *testing.T) {
//
// node, err := genSimpleQueryNode(ctx)
// assert.NoError(t, err)
//
// task := watchDmChannelsTask{
// req: genWatchDMChannelsRequest(),
// node: node,
// }
// task.req.Infos = []*datapb.VchannelInfo{
// {
// CollectionID: defaultCollectionID,
// ChannelName: defaultVChannel,
// SeekPosition: &msgstream.MsgPosition{
// ChannelName: defaultVChannel,
// MsgID: []byte{1, 2, 3},
// MsgGroup: defaultSubName,
// Timestamp: 0,
// },
// },
// }
// err = task.Execute(ctx)
// assert.Error(t, err)
//})
}
func TestTask_loadSegmentsTask(t *testing.T) {