Zhen Ye d3e32bb599
enhance: make pchannel level flusher (#39275)
issue: #38399

- Add a pchannel level checkpoint for flush processing
- Refactor the recovery of flushers of wal
- make a shared wal scanner first, then make multi datasyncservice on it

Signed-off-by: chyezh <chyezh@outlook.com>
2025-02-10 16:32:45 +08:00

44 lines
1.1 KiB
Go

package resource
import (
"testing"
"github.com/stretchr/testify/assert"
clientv3 "go.etcd.io/etcd/client/v3"
"github.com/milvus-io/milvus/internal/mocks/mock_metastore"
"github.com/milvus-io/milvus/internal/mocks/mock_storage"
"github.com/milvus-io/milvus/internal/types"
"github.com/milvus-io/milvus/pkg/util/paramtable"
"github.com/milvus-io/milvus/pkg/util/syncutil"
)
func TestApply(t *testing.T) {
paramtable.Init()
Apply()
Apply(OptETCD(&clientv3.Client{}))
Apply(OptRootCoordClient(syncutil.NewFuture[types.RootCoordClient]()))
assert.Panics(t, func() {
Done()
})
Apply(
OptChunkManager(mock_storage.NewMockChunkManager(t)),
OptETCD(&clientv3.Client{}),
OptRootCoordClient(syncutil.NewFuture[types.RootCoordClient]()),
OptDataCoordClient(syncutil.NewFuture[types.DataCoordClient]()),
OptStreamingNodeCatalog(mock_metastore.NewMockStreamingNodeCataLog(t)),
)
Done()
assert.NotNil(t, Resource().TSOAllocator())
assert.NotNil(t, Resource().ETCD())
assert.NotNil(t, Resource().RootCoordClient())
}
func TestInitForTest(t *testing.T) {
InitForTest(t)
}