mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 02:48:45 +08:00
fix: Fix the unstable unit test TestReplicateManager
(#28718)
/kind improvement Signed-off-by: SimFG <bang.fu@zilliz.com>
This commit is contained in:
parent
86ccb8e146
commit
089e58dfbb
@ -52,7 +52,10 @@ func TestReplicateManager(t *testing.T) {
|
|||||||
assert.Equal(t, 3, i)
|
assert.Equal(t, 3, i)
|
||||||
res := resourceManager.Delete(ReplicateMsgStreamTyp, "test")
|
res := resourceManager.Delete(ReplicateMsgStreamTyp, "test")
|
||||||
assert.NotNil(t, res)
|
assert.NotNil(t, res)
|
||||||
time.Sleep(2 * time.Second)
|
|
||||||
|
assert.Eventually(t, func() bool {
|
||||||
|
return resourceManager.Delete(ReplicateMsgStreamTyp, "test") == nil
|
||||||
|
}, time.Second*4, time.Millisecond*500)
|
||||||
|
|
||||||
_, err = manager.GetReplicateMsgStream(context.Background(), "test")
|
_, err = manager.GetReplicateMsgStream(context.Background(), "test")
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
@ -61,7 +64,10 @@ func TestReplicateManager(t *testing.T) {
|
|||||||
{
|
{
|
||||||
res := resourceManager.Delete(ReplicateMsgStreamTyp, "test")
|
res := resourceManager.Delete(ReplicateMsgStreamTyp, "test")
|
||||||
assert.NotNil(t, res)
|
assert.NotNil(t, res)
|
||||||
time.Sleep(2 * time.Second)
|
|
||||||
|
assert.Eventually(t, func() bool {
|
||||||
|
return resourceManager.Delete(ReplicateMsgStreamTyp, "test") == nil
|
||||||
|
}, time.Second*4, time.Millisecond*500)
|
||||||
|
|
||||||
res, err := resourceManager.Get(ReplicateMsgStreamTyp, "test", func() (resource.Resource, error) {
|
res, err := resourceManager.Get(ReplicateMsgStreamTyp, "test", func() (resource.Resource, error) {
|
||||||
return resource.NewResource(resource.WithObj("str")), nil
|
return resource.NewResource(resource.WithObj("str")), nil
|
||||||
|
Loading…
Reference in New Issue
Block a user