MCPcopy
hub / github.com/pingcap/tidb / CreateStoreAndBootstrap

Function CreateStoreAndBootstrap

pkg/session/testutil.go:42–49  ·  view source on GitHub ↗

CreateStoreAndBootstrap creates a mock store and bootstrap it.

(t *testing.T)

Source from the content-addressed store, hash-verified

40
41// CreateStoreAndBootstrap creates a mock store and bootstrap it.
42func CreateStoreAndBootstrap(t *testing.T) (kv.Storage, *domain.Domain) {
43 testenv.SetGOMAXPROCSForTest()
44 store, err := mockstore.NewMockStore(mockstore.WithStoreType(mockstore.EmbedUnistore))
45 require.NoError(t, err)
46 dom, err := BootstrapSession(store)
47 require.NoError(t, err)
48 return store, dom
49}
50
51var sessionKitIDGenerator atomicutil.Uint64
52

Calls 4

SetGOMAXPROCSForTestFunction · 0.92
NewMockStoreFunction · 0.92
WithStoreTypeFunction · 0.92
BootstrapSessionFunction · 0.85