diff --git a/internal/datanode/data_node_test.go b/internal/datanode/data_node_test.go index c59ab54872..349f63f576 100644 --- a/internal/datanode/data_node_test.go +++ b/internal/datanode/data_node_test.go @@ -386,7 +386,7 @@ func TestDataNode(t *testing.T) { require.NoError(t, err) require.Equal(t, 1, len(node.vchan2FlushCh)) require.Equal(t, 1, len(node.vchan2SyncService)) - time.Sleep(time.Second) + time.Sleep(100 * time.Millisecond) node.ReleaseDataSyncService(dmChannelName) assert.Equal(t, 0, len(node.vchan2FlushCh)) diff --git a/internal/indexcoord/index_coord_test.go b/internal/indexcoord/index_coord_test.go index 6118484079..dc25a7b13d 100644 --- a/internal/indexcoord/index_coord_test.go +++ b/internal/indexcoord/index_coord_test.go @@ -112,7 +112,7 @@ func TestIndexCoord(t *testing.T) { resp.States[0].State == commonpb.IndexState_Failed { break } - time.Sleep(1 * time.Second) + time.Sleep(100 * time.Millisecond) } }) @@ -182,7 +182,7 @@ func TestIndexCoord(t *testing.T) { indexMeta := ic.metaTable.GetIndexMetaByIndexBuildID(indexBuildID) for indexMeta != nil { indexMeta = ic.metaTable.GetIndexMetaByIndexBuildID(indexBuildID) - time.Sleep(time.Second) + time.Sleep(100 * time.Millisecond) } }) diff --git a/internal/indexnode/indexnode_test.go b/internal/indexnode/indexnode_test.go index 8007ef2197..1f249f1b29 100644 --- a/internal/indexnode/indexnode_test.go +++ b/internal/indexnode/indexnode_test.go @@ -170,7 +170,7 @@ func TestIndexNode(t *testing.T) { err = proto.UnmarshalText(value, &indexMetaTmp) assert.Nil(t, err) for indexMetaTmp.State != commonpb.IndexState_Finished { - time.Sleep(time.Second) + time.Sleep(100 * time.Millisecond) value, err = in.etcdKV.Load(metaPath1) assert.Nil(t, err) err = proto.UnmarshalText(value, &indexMetaTmp) @@ -280,7 +280,7 @@ func TestIndexNode(t *testing.T) { err = proto.UnmarshalText(value, &indexMetaTmp) assert.Nil(t, err) for indexMetaTmp.State != commonpb.IndexState_Finished { - time.Sleep(time.Second) + time.Sleep(100 * time.Millisecond) value, err = in.etcdKV.Load(metaPath2) assert.Nil(t, err) err = proto.UnmarshalText(value, &indexMetaTmp) @@ -574,7 +574,7 @@ func TestCreateIndexFailed(t *testing.T) { err = proto.UnmarshalText(value, &indexMetaTmp) assert.Nil(t, err) for indexMetaTmp.State != commonpb.IndexState_Failed { - time.Sleep(time.Second) + time.Sleep(100 * time.Millisecond) value, err = in.etcdKV.Load(metaPath1) assert.Nil(t, err) err = proto.UnmarshalText(value, &indexMetaTmp) @@ -692,7 +692,7 @@ func TestCreateIndexFailed(t *testing.T) { err = proto.UnmarshalText(value, &indexMetaTmp) assert.Nil(t, err) for indexMetaTmp.State != commonpb.IndexState_Failed { - time.Sleep(time.Second) + time.Sleep(100 * time.Millisecond) value, err = in.etcdKV.Load(metaPath2) assert.Nil(t, err) err = proto.UnmarshalText(value, &indexMetaTmp) diff --git a/internal/kv/etcd/etcd_kv_test.go b/internal/kv/etcd/etcd_kv_test.go index b881f0f7d1..7947e82de8 100644 --- a/internal/kv/etcd/etcd_kv_test.go +++ b/internal/kv/etcd/etcd_kv_test.go @@ -495,7 +495,7 @@ func TestElapse(t *testing.T) { isElapse := etcdkv.CheckElapseAndWarn(start, "err message") assert.Equal(t, isElapse, false) - time.Sleep(time.Duration(3) * time.Second) + time.Sleep(2001 * time.Millisecond) isElapse = etcdkv.CheckElapseAndWarn(start, "err message") assert.Equal(t, isElapse, true) } diff --git a/internal/proxy/channels_time_ticker_test.go b/internal/proxy/channels_time_ticker_test.go index 34e638b896..15927597fc 100644 --- a/internal/proxy/channels_time_ticker_test.go +++ b/internal/proxy/channels_time_ticker_test.go @@ -68,7 +68,7 @@ func TestChannelsTimeTickerImpl_start(t *testing.T) { assert.Equal(t, nil, err) }() - time.Sleep(time.Second) + time.Sleep(100 * time.Millisecond) } func TestChannelsTimeTickerImpl_close(t *testing.T) { @@ -90,7 +90,7 @@ func TestChannelsTimeTickerImpl_close(t *testing.T) { assert.Equal(t, nil, err) }() - time.Sleep(time.Second) + time.Sleep(100 * time.Millisecond) } func TestChannelsTimeTickerImpl_addPChan(t *testing.T) { @@ -118,7 +118,7 @@ func TestChannelsTimeTickerImpl_addPChan(t *testing.T) { assert.Equal(t, nil, err) }() - time.Sleep(time.Second) + time.Sleep(100 * time.Millisecond) } func TestChannelsTimeTickerImpl_getLastTick(t *testing.T) { @@ -156,7 +156,7 @@ func TestChannelsTimeTickerImpl_getLastTick(t *testing.T) { } } }() - time.Sleep(time.Second) + time.Sleep(100 * time.Millisecond) b <- struct{}{} wg.Wait() @@ -165,7 +165,7 @@ func TestChannelsTimeTickerImpl_getLastTick(t *testing.T) { assert.Equal(t, nil, err) }() - time.Sleep(time.Second) + time.Sleep(100 * time.Millisecond) } func TestChannelsTimeTickerImpl_getMinTsStatistics(t *testing.T) { @@ -203,7 +203,7 @@ func TestChannelsTimeTickerImpl_getMinTsStatistics(t *testing.T) { } } }() - time.Sleep(time.Second) + time.Sleep(100 * time.Millisecond) b <- struct{}{} wg.Wait() @@ -212,5 +212,5 @@ func TestChannelsTimeTickerImpl_getMinTsStatistics(t *testing.T) { assert.Equal(t, nil, err) }() - time.Sleep(time.Second) + time.Sleep(100 * time.Millisecond) }