mirror of https://github.com/milvus-io/milvus.git
Fix Group Checker test fail (#20911)
Signed-off-by: lixinguo <xinguo.li@zilliz.com> Signed-off-by: lixinguo <xinguo.li@zilliz.com> Co-authored-by: lixinguo <xinguo.li@zilliz.com>pull/20928/head
parent
82fe655032
commit
f7d603f947
|
@ -26,7 +26,9 @@ import (
|
|||
func TestGroupChecker(t *testing.T) {
|
||||
groupName := `test_group`
|
||||
signal := make(chan []string, 1)
|
||||
gc1 := GetGroupChecker(groupName, 10*time.Millisecond, func(list []string) {
|
||||
// 10ms period which set before is too short
|
||||
// change 10ms to 500ms to ensure the the group checker schedule after the second value stored
|
||||
gc1 := GetGroupChecker(groupName, 500*time.Millisecond, func(list []string) {
|
||||
signal <- list
|
||||
})
|
||||
gc1.Check("1")
|
||||
|
@ -35,7 +37,7 @@ func TestGroupChecker(t *testing.T) {
|
|||
})
|
||||
gc2.Check("2")
|
||||
|
||||
assert.Equal(t, 10*time.Millisecond, gc2.d)
|
||||
assert.Equal(t, 500*time.Millisecond, gc2.d)
|
||||
|
||||
list := <-signal
|
||||
assert.ElementsMatch(t, []string{"1", "2"}, list)
|
||||
|
|
Loading…
Reference in New Issue