fixing the goroutine in two unit tests

This commit is contained in:
Linhai 2021-12-21 04:46:39 -05:00
parent 29292aa7bd
commit 246e7eba09
2 changed files with 4 additions and 1 deletions

View File

@ -536,6 +536,8 @@ type hashKVResult struct {
func TestHashKVWhenCompacting(t *testing.T) {
b, tmpPath := betesting.NewDefaultTmpBackend(t)
s := NewStore(zap.NewExample(), b, &lease.FakeLessor{}, StoreConfig{})
defer s.Close()
defer b.Close()
defer os.Remove(tmpPath)
rev := 10000

View File

@ -536,7 +536,8 @@ func TestWatchVictims(t *testing.T) {
s := newWatchableStore(zap.NewExample(), b, &lease.FakeLessor{}, StoreConfig{})
defer func() {
s.store.Close()
s.Close()
b.Close()
os.Remove(tmpPath)
chanBufLen, maxWatchersPerSync = oldChanBufLen, oldMaxWatchersPerSync
}()