mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-09 07:19:23 +08:00
30 lines
740 B
Go
30 lines
740 B
Go
|
package rootcoord
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func Test_waitForTsSyncedStep_Execute(t *testing.T) {
|
||
|
//Params.InitOnce()
|
||
|
//Params.ProxyCfg.TimeTickInterval = time.Millisecond
|
||
|
|
||
|
ticker := newRocksMqTtSynchronizer()
|
||
|
core := newTestCore(withTtSynchronizer(ticker))
|
||
|
core.chanTimeTick.syncedTtHistogram.update("ch1", 100)
|
||
|
s := &waitForTsSyncedStep{
|
||
|
baseStep: baseStep{core: core},
|
||
|
ts: 101,
|
||
|
channel: "ch1",
|
||
|
}
|
||
|
children, err := s.Execute(context.Background())
|
||
|
assert.Equal(t, 0, len(children))
|
||
|
assert.Error(t, err)
|
||
|
core.chanTimeTick.syncedTtHistogram.update("ch1", 102)
|
||
|
children, err = s.Execute(context.Background())
|
||
|
assert.Equal(t, 0, len(children))
|
||
|
assert.NoError(t, err)
|
||
|
}
|