*: fix goleak when to use CreateMockStoreAndDomain (#38734)

close pingcap/tidb#38731
This commit is contained in:
Weizhen Wang
2022-11-01 11:47:59 +08:00
committed by GitHub
parent 37ed0ab3e4
commit 5a8fd6da57

View File

@ -69,6 +69,10 @@ func CreateMockStoreAndDomain(t testing.TB, opts ...mockstore.MockTiKVStoreOptio
dom := bootstrap(t, store, 500*time.Millisecond)
sm := MockSessionManager{}
dom.InfoSyncer().SetSessionManager(&sm)
t.Cleanup(func() {
view.Stop()
gctuner.GlobalMemoryLimitTuner.Stop()
})
return schematracker.UnwrapStorage(store), dom
}